Presentation templates
In WordFrame Integra the webframe presentation templates are a mix of standard HTML and webframe specific presentation tags. It is used for complete management of the content presented by the webframe, by altering the generated HTML code. Many of the webframes have such manageable presentation, which could be found always in their specific settings.
The presentation template has two elements - its tags and textarea.
Template tags
The tags are string keys that are always surrounded by {{ }}. They are specific for the template textarea that follows them and can be applied only there. If you paste such a template tag on other part of the webframe settings or in completely different webframe, it will be rendered as text. There are two types of template tags:
- Mandatory - these tags need to be present in the template text area in order to submit the settings. If you want not to display a mandatory tag for some reason (ex. the search button) you can hide it by inserting it in a "display:none" styled div element.
- Non-mandatory - these tags are not required to be present in the template text area.
After each save, the system will mark the used tags by switching their text color to blue.
Template textarea
Here you can type the needed html code and embed the tags in it. The system will substitute the supported tags by the template with the corresponding controls or strings. As an example the presentation template of the ITBrix.Blog.Post:
<div class="username">{{author_username}}</div>
Will be rendered by the system as
<div class="username">JohnDoe</div>
Available template tags options
Some templates support options for their tags. Use the webframe help page for reference. Examples of such options are:
HTML editor modes
The WYSIWYG editor in most of the webframes can be managed through option, which one of the 5 predefined modes should be presented - none, basic, simple, default, advanced, full. As an example, here is how the presentation tag in the ITBrix.Blog.ManagePost looks like, when we want to use only a textarea without an editor:
{{ctrl_content_htmlbox $|$ none}}
As you can see in this case the mode is submitted as an option to the tag, by using the "$|$ mode"
Template tags in combination with functional tags
In many cases, you need to use a presentation template in a combination with a functional tag. The most common case is presenting the user's profile name in a ITBrix.Blog.ViewPost. In this case you will need to provide the authors username to the "profile" functional tag. This could be done with the following example:
{{profile: name $|$ {{author_username}}}}
In a case when you are not sure, whether the presentation tag will produce any result (if the profile field is not yet submitted by the user), you can set a default value of the functional tag. Most of the functional tags have such option. In this case the example above will be changed to:
{{profile: name $|$ {{author_username}} $|$ {{author_username}} }}
If the name is not yet submitted by the author, the username will be used instead