Views
Stacks API templet.html Reference
From YourHead
Contents |
What is an HTML Template
The template is an HTML file that contains just the content that will appear inside of the frame. This template does not include the frame itself, or the borders, margin, padding or width that the frame already provides. All the template provides is the raw content. The HTML Template is part of the Stacks API, more details about the whole Stacks API can be found in the Stacks API Reference.
What kind of content is allowed
The content should be valid xHTML and should validate strict. If the content does not validate, it might disrupt other content on the user's page, or even cause Stacks and RapidWeaver to crash. You can use any valid HTML, but due browser limitations of nesting containers, its recommended that you do not use tables as containers.
How the template works
The HTML Template will be inserted into the page when drags your library item into their layout. The template has special key words that may be used to add special functionality to the element.
Template Keyword Reference
Stack Container
- Template Variable
- %slice%
- Description
- The slice keyword will be replaced by a generic container. Users will be able to add other slices inside of this container.
Image Container
- Template Variable
- %image%
- Description
- This keyword will be replaced by an image container. Users will be able to add and edit images with it.
Styled Text Container
- Template Variable
- %text%
- Description
- This keyword will be replaced by a Styled Text area. Users will be able to edit text, add styles and links, and generally do everything a RapidWeaver Styled Text page can do.
Plain Text Container
- Template Variable
- %html%
- Description
- This keyword will be replaced by a plain-text area. This is most often used for adding HTML directly to the page. Any text can be added there, of course, but the formatting, links, and other attributes of Styled Text will not be available. The text is taken as-is and inserted directly into the page.
Asset Path
- Template Variable
- %assetPath%
- Description
- This keyword will be replaced by the path to Stacks' assets directory for the page. This will be needed to link to assets that have been included.
Custom Interface Values
- Template Variable
- %id=interfaceID%
- Description
- This keyword will be replaced by one of the custom user interface items that has been defined in your Info.plist file.
Your Info.plist file can define custom user interface elements and calculations. The values of those elements will be injected into the page at this point. Each interface element value is matched to the template by the interfaceID.
Special
- Template Variable
- %stack%
- Description
- This is a special purpose keyword that is used inside the Stack library component. It should not be used in other templates.
