Join Michael Murphy for an in-depth discussion in this video Using separate InDesign files for a modular template, part of InDesign for Web Design.
The kinds of standard elements you see on all pages of a site, its header, nav bar, and Footer typically, are rarely coded directly into that page's HTML. More often than not, these site wide modules are separate files inserted dynamically into that page when the browser asks for it. This is typically done using a server-side or PHP include statement, and you can actually take a similar protein InDesign by breaking your site wide elements out into separate InDesign documents, then placing those individual documents back into a more modular template.
Let's take a look at what I mean. I am going to choose File > Open and open up the site_template.indt file that's in the Exercise Files folder. That opens a new untitled document using my existing template. I'll open the Pages panel and go to the master page where all of my elements reside. Then I'll switch to Layers panel, because I am going to be using that to select certain items. At the top of the page the logo and the nav bar are items that are going to appear on every page.
One approach is exactly what we have here to keep it on the master page of this document. But another approach is to remove these from this document, and control them from a completely separate InDesign document. So while I have the two selected, before I cut them to the clipboard, I want to take advantage of the information I get in the control panel, which shows me that this entire selection, these two objects together, are 960 pixels across by 150 pixels deep, and that tells me exactly what size to create my new document.
So I'll cut these objects to the clipboard, create a new InDesign document with a Web Intent at exactly that size 960x150, and I'll set the Margins to 0 all the way across the board and click OK. I can now paste what I copied into this document, and you may notice that I've got pink font highlighting in here which indicates a missing font. Now the font wasn't missing in the original template file. However, that file was saved in a folder that had a Document Font's folder that included the necessary fonts and they were available to that document.
This document has not been saved yet. It doesn't know that it has document fonts available to it until I save it into a location with a document fonts folder, close it and then reopen it, and I'll demonstrate that in a moment. But first InDesign has a pesky habit of not putting things in exactly at 0 and 0. So before you save and close this document, you want to make sure that you take a look at those X, Y coordinates and make sure that they reflect 0 and 0 in the top left. I really don't need to do anything else here except save the document, and I'll call this brand_and_nav.indd, and I am going to save it in this same Exercise Files folder where that Document Fonts folder is.
I'll click Save, I'll close it, and let me just open it again to see that the font issue is resolved. I'll double-click it. When I open it again now that it knows it's sharing the same directory as the Document Fonts folder, I no longer have the pink highlighting. I can take the same approach with the footer, and I can just Option-click the Footer layer in my Layers panel. I'll take a quick look up in a control panel that's 960x240.
I'll cut it to the clipboard, create a New Web Intended document that is also 960x240, and I'll set its Margins to 0 all the way around. Click OK, paste my footer content in there, same font problem, but it will be resolved the exact same way. Check the Control panel to make sure everything is at 0 and 0, save the document as footer.indd, and close it. Lastly I'll do the same thing with the sidebar.
I'll just Option-click this Sidebar Content layer, and that's really why I use layers, it makes it very easy to just grab everything on a layer at once. I'll take a look up here. I have got 320 pixels 902.66 pixels. Now I know in earlier movies I've cautioned about doing your best in web design to keep things at exact pixels, but here I am actually bending that rule a bit. All of the frames here in the Sidebar have autosize turned on as part of their text frame attributes and autosize doesn't let you round up to the nearest number, but the autosize functionality has allowed me to pull off some nice interesting reflow tricks here in these items.
So I'm going to err on the side of getting what I want in my mockup, and I'll deal with that rounded pixel at a later time when I hand it off to a developer. So bearing that in mind, I am going to cut this to the clipboard and create a new InDesign document with a Web Intent that's 320x903. I am going to round it up here in the document even though my content falls a little bit short of that. Again, Margins at 0, I'll click OK, paste the content on the page, adjust its X, Y coordinates to 0.
You'll notice that the height of the selected object is entirely different here than when I copied it, and that's because the font is missing. So these adjustable frames are adapting to this placeholder font. So nothing quite lines up exactly right here. But as soon as the font problem is solved so will the height problem be. I'll Save this as sidebar.indd and close it. Now I'm back in my original template file with all of my design content missing, and I want to re-place all of these little modules that I've created in separate InDesign documents back into the template.
So from the File menu I'll choose Place, and I am going to grab all three at once, sidebar.indd, footer.indd, and brand_and_nav.indd. I'll click Open and the first one that shows up here with this little preview is my header. I'll just click and drop that on the page, I have got my footer, I'll click and drop that down here temporarily, and my sidebar, I'll drop that down here as well. Notice that any part of my InDesign document that doesn't have content is actually transparent.
I can see right through it, which is really helpful. So I can just drag this into position exactly where I want, and I do want it at 32 pixels from the left and 0 pixels from the top. My footer I want to drop in also, align to that 32 pixel mark, if it's not exact I can adjust it in the control panel. I want is to align exactly the bottom of my 1500 pixel high page so I am going to check this bottom proxy and type in 1500 here, and that will snap that right down to the bottom of the page.
Lastly, I'll put in my sidebar, and I want that to snap in over here and be at 200 pixels at the top. So I'll just type that in there. So now I've got the same look and feel in my template except I'm dealing with outside resources for all of these standard page elements. So someone else could theoretically be working on changes to the nav bar or changes to the sidebar content or adjustments to the footer and those will, when they are updated, show up for me as links that need to be updated.
If I'm just working on this myself, and I want to make it change to something in the sidebar, I can actually Option+Double-click it the same way I would do any linked image. It will open up that InDesign file. I can start making a change in here. Let's say, for example, one of those links comes out. My little autosize trick adjusts everything accordingly. I can save sidebar.indd, and when I come back here it automatically updates in my document.
I can then save this as a new template called site_template_modular.indt and then whenever I am ready to start working on page design using this more modular approach, I will just open this template. The only thing I'll caution about this particular approach is it does keep things discreet, separate, and very convenient to drop in, and it eliminates the number of objects on your master page. But if your goal is to start using things like InDesign's Liquid Layout features and keep the objects on your page a little bit more flexible then these items are not going to adapt the way native InDesign objects on a page are going to adapt.
So you have to think about what your goal is and then create the kind of template that works according to that goal.
- Understanding web concepts such as pages, pixels, and the box model
- Working within web colors and grids
- Working with type and type styles
- Designing a nav bar with tables
- Setting up a template with headers, footers, and modular content
- Experimenting with liquid and alternate layouts
- Adding interactive content such as links and video
- Exporting flat PNG and JPEG comps
- Exporting HTML and CSS content