Data Merge meets Facing Pages in InDesign

Because of my position in the Yearbook club as 'chief editor' I had to figure out a way to produce a consistent and nice looking layout fully automated, so we don't need to copy and past every piece of content which would be a rediciously waste of time and I'm sure some former Yearbook clubs have experienced this pain (or hired some 'expert').

A nice layout has to aware of the position of the current page which cant't be done with Adobe's native Data Merge options. There are only a few forum threads on this topic and the majority gave up.

But I figured out a way:

  • Design a facing layout with the same varibles on each side.

Indesign screenshot

  • Merge your data with the document so you get a duplicated set of data on every page with two different layouts.

  • Delete the pages you don't want using a script.

For example this one:

you have to turn off "Enable new document page order" by right clicking the master page area in your pages panel The first page has to be on the right and shouldn't represent a set of data

main();  
function main(){  
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
    loop();
}
function loop(){  
    var myDocument = app.activeDocument;
    var length = myDocument.pages.length;
    var Pages = [];
    var j = 0;
    for (var i=0; i < length; i++){
        var Page = myDocument.pages.item(i);
        var id = i%4;
        if (id > 1){
            Pages[j] = Page;
            j++;
        }
    }
    for (var i = 0; i <= j; i++) {
        Pages.pop().remove();
    };
}

`