Go to page content

Tags

Tags add logic and flexibility to your templates.

Zotonic tags are in general compatible with Django tags, though there are some differences in which arguments are accepted. Not all Django tags are implemented.

Zotonic also adds some new tags and filters unknown to Django. For example the tags image and trans.

When you are trying to find a tag used in a template, and it is not listed here, then check the list of all scomps as the scomp syntax is identical to the tag syntax.

Search the documentation

  • all catinclude

    Include a template for all a resource’s categories from all modules.

  • all include

    Call all modules to include a certain template.

  • autoescape

    Automatically apply HTML escaping to values.

  • block

    Overrule a block from an inherited template.

  • cache

    Cache a frequently used block for later reuse.

  • call

    Call an Erlang function.

  • catinclude

    Include another template based on the category of a resource. The include tag…

  • comment

    Ignore part of a template.

  • cycle

    Rotate through a list of values.

  • _ extended translation

    Select a translation from the arguments.

  • extends

    Inherit markup from another template.

  • filter

    Filter the contents of a block through variable filters. [new in 0.8-dev]

  • for

    Loop over multiple values in a list or search result.

  • if

    Show a block if the condition is true.

  • ifequal

    Show a block when two values are equal.

  • ifnotequal

    Show a block when two values are not equal.

  • image

    Show a still image using a <img/> element.

  • image_url

    Generate the url of a still image.

  • include

    Include another template. The include tag is replaced with the contents of the…

  • inherit

    Insert the overruled block from an extended template.

  • lib

    Combine css and javascript includes in a single request.

  • media

    Show embed, video or audio media.

  • now

    Show the current date and time.

  • overrules

    Inherit markup from like named template in another module.

  • print

    Show the contents of a value expression.

  • raw

    Make a literal section which does not interpret tags.

  • spaceless

    [0.8+] Removes whitespace between HTML tags.

  • trans

    Translate a text value using gettext.

  • url

    Generate the url for a named dispatch rule.

  • with

    Assign a complex value to a variable.