Managing Multiple Static Templates

Chrissy Wainwright

Problem

If you use multiple static templates, this can lead to several places where static content needs to be updated.

You have repeated code, and you don't want to forget to update any spot when something changes.

Possible Solutions

  1. Create a static macros template
  2. Replace with HTML in rules.xml
  3. Use one static template

What is a Static Macro?

Puts your repeated static content into a single template.

This method will allow you to make the change in one place.

Static Macro Magic

In the HTML:

<div id="footer">Code to be replaced by static macro.</div>

create a macros.html:

<div id="header">Actual header code here.</div>
<div id="footer">Actual footer code here.</div>

rules.xml:

<replace css:theme="#footer" css:content="#footer"
         href="++theme++diazotheme/macros.html"

HTML in rules.xml

Instead of a macros.html, you could also just put the HTML into the rules.xml:

<replace css:theme="#footer">
    <div id="footer">Actual footer code here.</div>
</replace>

Con: You can end up with too much HTML in the rules file.

Pro: This has the advantage of being able to use variables.

Use a Single Template

May not always be possible depending on your situation.

For multiple column options:

SpaceForward
Right, Down, Page DownNext slide
Left, Up, Page UpPrevious slide
POpen presenter console
HToggle this help