Jinja2 Renderer
Values from the Query:
For All HTML Fields
You can access a specific column index with two possible formats
Format 1
{{columns["<COLUMN_NAME>"][<INDEX>]}}
Format 2
{{columns.<COLUMN_NAME>.<INDEX>}}
For the Template Section Only
This format will be rendered as each value returned by the query result.
Format 1
{{column["<COLUMN_NAME>"]}}
Format 2
{{column.<COLUMN_NAME>}}
Usage
Example:
<h1>{{column["<COLUMN_NAME>"]}}</h1>
Text Resources
For All HTML Fields
You can access text resources with the following formats
Format 1
{{text["<TEXT_RESOURCE_NAME>"]}}
Format 2
{{text.<TEXT_RESOURCE_NAME>}}
Usage
Example:
<h1>{{text["<TEXT_RESOURCE_NAME>"]}}</h1>
Image Resources
For All HTML Fields
You can access image resources with the following formats:
Format 1
{{image["<IMAGE_RESOURCE_NAME>"]}}
Format 2
{{image.<IMAGE_RESOURCE_NAME>}}
Usage
Use it in a <img> tag to see your image in your pages and portlets.
Example:
<img src="{{image['<IMAGE_RESOURCE_NAME>']}}" width="auto" height="auto">
Path Segments
For All HTML Fields
You can access path segments if you have declared at least one in your page path with the following formats:
Format 1
{{path_segment["<PATH_SEGMENT_NAME>"]}}
Format 2
{{path_segment.<PATH_SEGMENT_NAME>}
Usage
Example:
user_info_page/<user_name>/<user_last_name>
Example of valid values for the page path can be:
user_info_page/john/williams
To get the name john from the page path you can use the variable path_segment variable
{{path_segment["<PATH_SEGMENT_NAME>"]}}
Replace <PATH_SEGMENT_NAME> with user_name, so your code should look like:
{{path_segment["user_name"]}}
To get the last name williams you can do:
{{path_segment["user_last_name"]}}
Export Variables
You can access export variables from the exports column with the following formats:
Format 1
{{export["<EXPORT_VARIABLE_NAME>"]}}
Format 2
{{export.<EXPORT_VARIABLE_NAME>}}
Usage
example:
<h1>{{export["<EXPORT_VARIABLE_NAME>"]}}</h1>