This tutorial enhances your first template by
adding a Dispatch query, as well as introducing building multiple
issues using a single template.
For additional information on Dispatch tags, please see the
Dispatch Reference Guide.
Open the template we created in the previous tutorial in your preferred ASCII text editor. This template should be named "section_default.html" and should contain the following code: <blockquote>
<font size="6"><dpHeadline></font><br>
<dpStory>
<div align="right"><a href="<dpPageForwardUrl>">Page Forward</a></div> </blockquote>
For this tutorial, we are going to build multiple issues from a single template. To demonstrate this, we are going to introduce the <dpQuery> tag. Please type in all of the new additions below (shown in red), so your template looks exactly like the following code. Save your file after you are done. <blockquote>
<font size="6"><dpHeadline></font><br>
<dpStory>
<dpQuery issue="archives" column="this" max="5">
</blockquote>
One of the Dispatch tags we are adding to this template is <dpQuery> which is used to query your publication database. In this case it will search through all of the publication archives looking for matching columns. If it finds matches, it will display their headlines and create links to the archived stories. The query tag is one of the more powerful tags in the Dispatch tag language. Please view the Dispatch Reference Guide for additional information on Dispatch tags.
Using your preferred FTP client, connect to your Dispatch FTP host. Upload your new template into the "templates" folder.
Once you are logged in to the Template Manager, select choose "Import Templates".
Make sure "Existing Set" is chosen, and select "Tutorial" from the drop-down menu.
The "New Templates Found" section should be visible. You will notice the template you uploaded in this list with a drop-down menu beside it. The drop-down menu should be set to "Sect: Default Template", based on how you named your template. If it isn't, please make that change now. Press "next" to continue.
From the end of the Import Templates process or the main Template Manager page, select "Test Templates." Choose the "Tutorial" template set and select 3-5 consecutive issues to build. This will demonstrate how a single template can be used to construct an entire site, as well as demonstrate the power of the <dpQuery> tag.
Uncheck "Show Debugging" if it is checked, and press "Next" to continue.
You should be able to see the output of your template as the issues are being built. The issues will be constructed from oldest to most recent. If you see any messages in red that say "warning", please read the warning to see what needs to be fixed and go back to the beginning of this tutorial to double check what you typed in.
When your issue is completed building, you should see a number of links and the "Build Complete" header. Click on the most recent of the issues you just built. Page through the issue and click on the links we added with the <dpQuery> tag. Notice how you can move backwards in time throughout the issues. For additional information on Dispatch tags and more elaborate examples of templates, view the Dispatch reference guide and site examples. Thank you for taking the "Building Multiple Issues" tutorial!
|
| Home: Support: Building Multiple Issues [3 of 4] | Questions? Comments? Post them to the Dispatch Technical Forum. |