16 April 2012
Basic understanding of InDesign and DPS workflows.
User level: All
Note: If you have questions about this article, use the comments feature at the bottom of the article. Please don’t contact technical support with questions about Adobe Developer Connection articles.
Digital Publishing Suite can be used to create a wide range of digital publications, from very hands-on, highly designed magazines to template-driven newspapers and catalogs. This article describes how InDesign and DPS can be used to create structured publications that retain some of the design aesthetic of highly designed publications and also take advantage of the efficiency benefits gained by using InDesign Templates and XML.
Structured publications are often published on a frequent schedule (such as daily or weekly) and often obtain content from many different sources, such as XML and RSS feeds. Publishers who produce these publications often wish to strike a balance between design aesthetic and time-to-publish efficiency. Ideally, they'd like to be able to combine the layout detail of InDesign documents with the efficient import characteristics of XML and HTML.
The great news is that this type of production is entirely possible by using a combination of InDesign Templates, XML tagging, InDesign Scripting, and DPS Import.
The demo assets and step-by-step instructions of this article demonstrate a simple example of how the technologies work together. For more details on any of the features, please refer to the XML and Scripting sections of the InDesign documentation. Note also that each of the actions below can be called using InDesign scripting. Automating the XML import process with InDesign scripts can unlock a level of efficiency needed for producing weekly and daily digital publications with DPS.
A logical way to begin creating the assets for your automated production system isby looking at the data feed(s) you have. In this case, Article.xml is a single file that contains all the data for this article. In real-world situations, article data might come from live data feeds (XML, RSS, or elsewhere) or it might be taken from a home-grown data aggregation system. Either way, it's important to start by understanding the structure of the data you're working with.
The Article.XML file contains everything I need to generate an article:
<text>, and three images
<image3>. In an automated environment, I would expect that each article I generate in the magazine would consist of these items, and the InDesign template I use will contain placeholder frames where the data for each of these items should go.
The next step is to create an InDesign template. This is easily done by opening a blank InDesign document and saving it as an InDesign template (File > Save As > InDesign Template (.indt). When an InDesign template is opened in InDesign, it copies all the existing contents of the template (including, in this case, empty placeholder frames) into a new, untitled InDesign document (.indd).
Next, add empty frames in the document where you want the images and text content to be placed. In this case, I created three empty frames for the images (one on each page), an empty frame for the title, teaser, and byline on the first page, and four separate frames (linked) on the second and third page to hold the article text.
The final step is to tag each of the empty frames with the corresponding content tags in the XML document. InDesign facilitates this process in the Tags panel (Window > Utilities > Tags) by using the Load Tags function in the pop-up menu. Click this function and point the Open File dialog to the Article.XML file.
The end result is a complete list of all the tags (color-coded) in the XML document now imported into the Tags panel. To associate each tag with its corresponding placeholder frame in the document, right-click the placeholder frame, select Tag Frame, and then choose the matching XML tag (see Figure 1).
You're almost done now. The final step is to build the XML structure for the data that will be imported. Start by opening the Structure Pane (View > Structure > Show Structure). Note that a root tag named "root" has been inserted automatically. Since the root tag in the XML document is "article", this needs to be replaced. To do this, click on the "article" tag in the Tags panel and drag and drop it onto the root tag in the Structure pane. This will replace the name "Root" with "Article."
Now the document is ready to import the XML data. Select File > Import XML, and click through the default options. The end result is the data in each of the tags in the XML document is loaded into its corresponding placeholder frame in the InDesign document (see Figure 2). You can name and save the document into a unique directory—and then add it to your folio as an individual article.
Although the demo illustrates the import of only two articles, the implication is that the process can be used (and automated) to import as many articles with the same structure as needed for a publication. The power of this concept is enormous—it's possible to build a single, nicely designed template with a structure that's common to all articles, and then repeat the import process for every article that's designed for that format. The generic process is as follows:
If you want to take this a step further, check out the Scripting documentation in InDesign Help. Using InDesign Scripting, it's possible to automate the first three steps listed above. Be sure to save your documents into unique subdirectories with the naming conventions required for DPS folios. Once you have a set of subdirectories populated with all the article content, you can use the Import function in the Folio Builder panel to import all the articles into a single folio. Voila! You've automated the process of creating an entire folio—and you can repeat and run this process as often as needed: monthly (for a magazine), weekly (for a weekly), or daily (for a newspaper).
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.