You are here: Home / Scripting


As administrator on our DemoSite you may add a Templated Document a templated portlet which allows you add dynamic content to Plone.

Use cases

  • Using unfiltered HTML (<script> etc.).
  • Add dynamic lists and tables on pages.
  • Add dynamic e-mail texts, subject lines and addressees in rule actions.
  • Show different text content for logged-in and non logged-in (anonymous) users.
  • Generate simple text portlets with dynamic contents.


For example, to get a list of all elements in the folder efficient usage you may put the following into the body text of a templated document:

{{ list_folder("efficient-usage").decode("utf-8") }}



Use the content type Templated Document.

Fields and widgets

TemplatedFieldIndex allows you to enter dynamic contents into a Templated Document, which may then generate the contents of a TextField () in your own content type.


Templated Portlet also enables scripting for portlets. Thus the following use cases are possible:

  • Show portlets depending on the given language
  • Show portlets for specific users only
  • Show portlets depending on time settings


To enable for scripting the fields recipients, subject and message in emails it is possible to use Templated Mail Action.


In the following section we describe the available variables and functions. Please note that the tags are described as functions and that for rendering () will have to be added.

For a Templated Document the following Plone variables are available:


The Plone site, e.g.

{{ portal.Title().decode("utf-8") }}

The context of the Templated Document, e.g.

{{ context.Title().decode("utf-8") }}
{{ context.absolute_url().decode("utf-8") }}

The URL of the Plone site, e.g.

<a href="{{ portal_url() }}">Home</a>
The URL of the object
The current user

Returns objects of the site according to the request, e.g.

{{ query({"portal_type":"News Item","sort_on":"Date","sort_order":"reverse"}) }}

Information on the current site status, e.g.

  • is the user logged in?
  • which is the navigation root?
  • the portal title
  • active language

Because Jinja expects the strings to be ASCII or Unicode you will have to recode all outputs that may contain Umlaut characters or similar to UTF-8.

Moreover you can also display Viewlets and Provider:

{{ viewlet("portal.logo") }}
{{ provider("plone.rightcolumn") }}

Further information

Document Actions