Catalogue Generation (Help)
Catalogue generation using Onix, InDesign CS3 and XSLT
We recommend you use InDesign CS3 or CS4 for catalogue generation. CS2 has some XML quirks that we've not been able to figure out.
(1) You'll need a base InDesign document (template).
This is fairly easy to create if you know InDesign if not we'd recommend you talk to someone who does as it will save a lot of time in the long run. We'll happily send you our template - at no cost - just email email@example.com.
(2) Ensure the text area on the master pages auto flow.
The text area from the left page should flow onto the right page. Check this by View > Show Text Threads. If you cannot see a line between the two text areas check the InDesign help under "Thread text frames".
(3) You are ready to generate your XML.
We've created a standard catalogue report that generates XML in a good format. You can get to this via the reports menu as seen below.
Save the XML. If the XML generated is not 100% what you require then you can download our XSLT from the XML menu. You can make changes and then upload your own new XSLT to use. You will probably need to change the path for images anyhow. If you are not comfortable making these changes email firstname.lastname@example.org. Alternatively use an XSLT on import of our XML with InDesign. You'll see the option shortly.
(4) Import your XML.
Set to append mode. Ideally the XML will have only one book node, but it doesn't matter if there are more. If there are more book nodes cut or delete the additional books. Now, do you have only one book node? If yes you are ready to place the xml.
(5) Place the XML.
Drag the "catalogue" node into the text area of the first page of your catalogue. This should import all your book data and flow in a default format. Your node structure should look something like:
Note: The catalogue node is showing as a text node in the structure on the right. If you do not see this you should not progress as the import was not done successfully.
(6) Style up your XML nodes.
Create new styles and map them to your XML tags. Apply general formatting that you require. Once you are happy the XML import will work this area should be the one you spend most time on!
If all goes wrong you want to get back to this point. You may also want to re-use this template.
(8) Flow the XML.
To do this click on the catalogue node (right click on a pc) then chose "Import XML"
You should choose the following options although you can play around a little to find out what works best for you. You may wish to check "Only import elements that match existing structure". If you need to change the order or the nodes or sort the XML you can do it here. Create a little XSL that applies a transform on import and check the Apply XSLT option.
If all went well you'll now have a nicely flowed and formatted page one. The text box will indicate an overflow with the little red cross down in the bottom right hand side of your text area.
(9) Create a new page.
Go to the page panel and create page two. (Ensure it has the correct master template.)
(10) Auto flow the remaining pages
Using the selection tool click to select the overflow text by clicking on the little red plus sign in the bottom right corner as indicated in (8). The cursor will change to indicate it has the overflow text, scroll to page two and shift-click to flow in the overflow text (holding down the shift key when you release onto page two causes auto flow which will create the required number of additional pages). Use the direct selection tool. (The selection tool should work but we've had issues with it.)
Clone repeating text elements: Use this to repeat descriptive text outside the nodes. By default just leave this on.
Ordering is important: InDesign will only import in the same order as it currently has. If you want to change the order or sort the results use an filter XSL on import of XML into InDesign. e.g. to sort add <xsl:sort select="Title"/> or there is a good example of sorting here.
Multi column layouts: Do not use multiple text areas. It wont work. Go to text frame options and make the text area (page) a multi column text area. See the update below.
Images: InDesign doesn't seem to support http image references. So you'll need a directory or some form of logical directory structure to find images. We've put in an image ref in the xml but you need to ideally swap this out with your own image path.
Not using our system: You can use the standard catalogue XSLT to translate Onix into an XML format that InDesign will import.
Update - March 2010
Multiple columns: It is possible to use multiple columns but your best bet is to still use a single column and restrict the output to a portion of the column. We've tried various things to anchor items but in the end we found scripts did the job best. There are some good scripts in the Adobe tool kit that you can download to do this... however if you just want to download and continue here is an InDesign Library file that has 1, 2 and 10 books per page layout. Simply download, open the library, drag the layout onto a page, move the objects around to the desired position, then import the XML.
Object Styles: we use object styles to apply styles to columns, text areas etc. By using object styles we can apply widths, fonts, colours etc. without having to use scripting. This means the customer can customise the result within InDesign without having to edit scripts.
XSLT's: here are some XSLT's that will help you transform your Onix into something more usable. Note: there are also some templates in the list. Just put them in the same folder as the others and the XSLT will be able to use the template.
Javascipt: for the 1 per page template we need the text to flow from one column to the next. The columns are not the same size, have a specific margin and are placed in unusual positions. We want the text to flow between the columns but anchored columns will not auto flow text. Also InDesign will "not create page furniture" on XML import so... we need to script the creationof the columns. Copy the script from here, save it to your user scripts areas, import the xml, run the script (by double clicking) and watch it creating pages for you. CS3 requires a re-run of the script on each import, CS4 will fire the script on re-import of the xml.
Mac OS: ~/Library/Preferences/Adobe InDesign/Version 5.0/Scripts
Windows XP: ~\Documents and Settings\user_name\Application Data\Adobe\InDesign\Version 5.0\Scriptsi
Or window -> automation -> scripts then right click in the scripts panel and select reveal in explorer.
CS4: CS4 is much better at page breaks and column breaks especially in respect to auto flowing XML. If you can, use it in preference to CS3 but all the content and scripts here will work equally well on both CS3 and CS4 on both Mac and PC.