Template variable Reference

  1. portfolio – The currently viewed site object
  2. files / portfolio.files – A dictionary of files associated at the site level (gear icon). e.g: {{ files.logo|thumb:"300x200" }} will render the “logo” file cropped and resized.
  3. page – The currently active page object. Each page may contain a thumbnail file (not related to the separatel multiple uploaded files) which is usually displayed in a catalog. e.g: {{ page|render_thumb:"300x200" }}
    1. page.dic – a dictionary of the texts. e.g: {{ page.dic.description }} or alternatively {{ page.dic.description|textile }} with textile formatting. Remember: Textile formatting requires {% load markup %} at the top of your template
    2. page.url – Full absolute URL of the page
    3. page.files – List of files associated with the current page. File should always use the thumb or render_thumb filters. e.g: {{ page.files.0|render_thumb:"300x200" }} will create an <img> tag with thumbnail cropped and resized to 300×200.
  4. pages – List of sub pages linked to the current page
  5. items – In case currently viewed template is item, items is a list of sub-pages of the parent page. This allows displaying related items to the current category. Otherwise this is a list of pages of template type “item”. If non such exist, this will default to the regular sub-pages equally to the “pages” parameter.
  6. next_item / prev_item – The next/previous page in the list of parent sub pages.
  7. pack – The site entity holding the design chosen for the currently rendered site. For example, in order to render the design’s CSS file: {{ pack.css.render }} will output the <link rel="stylesheet"> tag which.

Filters

  1. thumb:”[width]x[height]” – Will resize and crop a file to the desired size and output the file URL only. e.g: {{ page.files.0|thumb:"300x200" }}
  2. render_thumb:”[width]x[height]” – Similarly to “thumb* filter but will render the entire &lt;img&gt; tag. It is advisable to use this filter rather than writing the <img> tag yourself in order to preserve <img> attributes such as width, height and alt. e.g: {{ page.files.0|render_thumb:"300x200" }}