Thanks for coming to InDesignSecrets.com, the world's #1 resource for all things InDesign!

Creating a Contact Sheet or Yearbook Page in InDesign

I’m off to speak at Russell Viers’ Yearbook Extravaganza this week in Germany (that’s not the real name, but I can’t remember it off the top of my head), and so I have yearbooks on my brain. More specifically, the number one problem every yearbook or photographer has: How to take hundreds (or thousands) of images and lay them out your page — in a grid — automatically. Whether it’s a yearbook page or a contact sheet, this simple task seems devilishly difficult in InDesign. Fortunately, there are some great tricks you can use.

First, the most obvious one: Gridify. We’ve discussed this in some detail in a few posts:

One of the downsides to gridify, however, is that it really only works with one page at a time. If you have a lot of images, it’s going to get tiresome pretty quickly.

Another method is to use a commercial contact sheet script, such as Image Catalog.

But InDesign has an awesome built-in method to create grids of hundreds or thousands of items, and it’s not hard to set up: Data Merge.

Gathering the Pieces

First, we want to place all the images in a single folder. In this case, I’ve ensured the person’s name is in the file name. (You can use Bridge or other tools to batch name files.)

Yb1

Next, we need a list of all those files, and it would be super helpful if we could get it in a CSV file, ready to be used by Data Merge. Fortunately, we have one, which you can download here. (I think this may have been written by Marc Autret, but I’m not sure? not even sure where I found it.) After you install it, it’ll show up in your Scripts panel and you can double-click it to run it. It asks for the folder, and builds a CSV file for you:

yearbook csv text

Lastly, you need a template into which you’ll flow your images and names. Here’s a simple one I just built:

yearbook template

The green border in the background is on a master page, so it’ll appear on every page. Then, on the document page, I’ve put a graphic frame and a text frame under it.

Building the Pages

If you’re looking closely, you’ll notice that there’s some text inside the frames you see in the image above. Those are Data Merge tags? to get them you need to first open the Data Merge panel (Window > Utilities > Data Merge). Choose “Select Data Source” from the Data Merge panel menu and point it to the csv file you just made.

data merge panel

To place the tags into the empty frames on your page, just select the frame and then click the tag in the panel. (The image tag needs to go into the graphic frame, obviously.)

Try turning on the Preview checkbox to see if it’s importing the image and caption properly. Unless the file name is exactly the person’s name, you’ll probably see something like:

Yb5

That’s okay, we’re going to process that text to look correct in a moment. But for now — assuming that the image and caption are importing properly — let’s turn off Preview and go ahead and actually merge the file. Choose Create Merged Document from the Data Merge panel menu, and set the Records Per Document Page to Multiple Records:

Create Merged Document

Next, switch to the Multiple Record Layout tab in this dialog box and set up margins and amount of space between columns and rows. It helps to have the Preview checkbox turned on here, so you can see how it’s going to look on the page:

Yb6b

When it looks right, click OK and InDesign builds a new document from the template you’ve created, importing every image in that folder:

yearbook finished page

Cleaning Up the File Name Gunk

Okay, I’ve gotten ahead of myself again? in the image above, the names (captions) don’t have all that code in them. How did I get rid of that gunk? You could do a fancy grep-based find/change, but instead, I made a set of grep styles that made that stuff disappear.

We’ve discussed grep styles in detail elsewhere on InDesignSecrets, so I’m just going to show you the codes I used for this particular example:

grep styles for disappear

The “disappear” character style is set to .1 pt, None color, so it just makes that text vanish! The “change to space” character style is similar: it sets the color to None, but changes the horizontal scaling to about 70%. “Disappear” is applied to the text before and after the name; the “change to space” style is applied to the underscore in the name.

Note that these grep styles probably won’t work for you because your file names will be different! Everyone has a different “standard” that they use for file naming. As I said, in this particular case, the people’s names are in the file names.

Of course, you don’t want to change this paragraph style in the document you just built (the one with all the images and captions in it)! No! Close that document and don’t save the changes. Go back to the original template you were working on and apply the grep styles there, then save your template. Okay, let’s add one more thing to the template before you merge again.

Use Object Styles

In order to have maximum flexibility with your files, you should create at least a couple of object styles — one for the caption text frame and one for the graphic frame. After you make these object styles and apply them to the frames, save the template. Now you can choose Create Merged Document from the Data Merge panel menu again!

The cool thing about master pages and object styles is that it’s super easy to change them later if the design changes. For example, here’s the same file, but with a different master page (gray background) and an altered object style:

object styles for yearbook

That’s it! Enjoy!

David Blatner

David Blatner

David Blatner is the co-founder of the Creative Publishing Network, InDesign Magazine, and the author or co-author of 15 books, including Real World InDesign. His InDesign videos at Lynda.com are among the most watched InDesign training in the world. You can find more about David at 63p.com.
David Blatner

Latest posts by David Blatner (see all)

  • - November 30, -0001
Related Articles
Comments

19 Comments on “Creating a Contact Sheet or Yearbook Page in InDesign

  1. InDesign definitely takes the work out of things :) I remember having to physically scan 1000’s of images for yearbooks. And typeset the yearbooks. It was fun to do it. How I would have loved InDesigns tools back then. of course, I’m sure there will be people that have put together yearbooks and not even used a computer to do it either :) I did really enjoy putting yearbooks together, it was fun to do it.

  2. A work of art, that’s great! Love the “disappear” thing.

    One thing: to do automatic layout for a yearbook, one of the challenges is to get the image filenames sorted alphabetically by last name in the CSV file. That might be possible with some OS file-naming utility or script.

  3. @AM: Excellent point. I was alphabetizing on the first name, not the last! So here you go:
    First, change the csv file to a txt (just change the name extension) and then place the txt file into InDesign.

    Next, use a grep find/change to get rid of the parts of the text you don’t want:

    That turns the text around so that the last name is first; you should then add one more “column head” so that it looks like this:

    To put them in the correct order, select all the rows except the first, and double-click the SortParagraphs.jsx script in the Scripts folder (it’s inside Application/Samples/Javascript folder).

    Now export this as a txt file (file > export, choose Text Only), and change the file name back to CSV.

    Finally, create your template, starting with the heading “Building the Pages” above. But this time you don’t have to use any of that messy GREP styles stuff to get rid of the codes (the stuff I called “file name gunk” above)… they’re already gone!

  4. the images to CSV script was Loic Aigon.

    I would have done almost the same thing as this post with the exception of using the GREPs to fix the captions, but instead would have made a live caption and run a bridge script on the folder of pics to put the names into the document title filed, sans the file extension.

    Otherwise, love the writeup!

  5. The CSV Script does not work if the file extension is .tiff (like the Acrobat export generates it). You need to add it to line 40

  6. The files I was given for a layout like this are named by Last name then first name (for example bacon grace.jpg) but I need the text under each photo to be first name then last name (Grace Bacon). I can get rid of the .jpg using the Grep style trick. Is there a way to flip flop the first and last name in Excel or InDesign w/o having to go in and change each one?

  7. Thank you for the tutorial, there is no need for script to make the CSV file (at least on Mac, not sure about PC) just open the folder containing the images, select the images you want to add, copy and paste into an excel or numbers sheet and save as csv, and it works on all files as well.
    About the GREP, personally I feel it’s too complicated. If you are experienced in excel, just split spaces or underscores to cells, delete the cells you don’t want or flip name/surnames, sort alphabetically by Name/Surname. Do all the steps in excel and then data merge.

  8. Dear,
    thank for your very helpful resources. I have a question: I’m making an e-book of photography and I want to make the summary or table of content with a miniature of the image, the number of the page and the note/didascale. I would that element are dynamic. Is it possible?
    Thank you a lot!
    Cristina.

  9. Hi, Thank you for this great tutorial. Actually I followed all the step over Indesign CS6 with no problem. The Problem with Indesign CC after doing all the steps and adjusting the margins in the frame. the software placed my images in my custom page shifted to the left the way I couldn’t preposition the frame again as if it is fixed to that position.

  10. Whats the key on creating a data merge? Coz When I try to add design around the document the whole page repeat on “multiple records” selected.
    But when I remove other things except the place holder for the image and text it works just fine.

    Im new to InDesign, any help is appreciated.

  11. Hi David. I just tried your instructions above and it worked great except I get ??? for the Chinese words that I am trying to bring in. I tried saving my CVS files as UTF8 but InDesign doesn’t recognize these files during the ‘Select Data Source’. Have you experienced this and is there a work around?

  12. Hello,
    Love this tutorial, but in my document the ‘multiple record layout’ is not an option. I can’t select multiple records. Is this a farmiliar problem?

Leave a Reply

Your email address will not be published. Required fields are marked *