Programmatic content inclusions
Overview
The content of text fields (e.g. paragraphs) can content instructions for Carbon Editor to include dynamic content. These instructions are written in a simple templating language which let's you for example include values from your Pages metadata information into its content.
Adding Page metadata
You can output as part of your Page's content the value of any metadata property for this Page.
All Pages have some metadata automatically generated by Carbon Editor and you can add your own either manually or programmatically, at import time or subsequently. For more information on the Metadata feature of Carbon Editor, please refer to the dedicated documentation.
To include metadata within a page, you can manually type in the required expression into any text field. The easiest way to get started is to browse the Page's metadata from within the sidebar whilst you are editing content and use the "Copy" button on the desired property. The instruction will recopied into your clipboard and you can paste it within any text field.
Adding the last modified timestamp to a Page
To include the date and /or time at which a Page was last modified as part of its content, for example in a footer, you can use the following:
Last modified: {{ data|from_key:"page.readonly.ls.carbon.editing.edited.at"|as_date|date:"d/m/Y H:i:s"|default:"Date unknown" }}
The output of which will be (for example) Last modified: 15/01/2019 14:26:08 or Date unknown if the page has never been saved (and therefore doesn't contain an editing date).
The pattern for the date format should be created following the Django template filter acceptable values.
Unless otherwise indicated in the Overview page of this WIKI the information contained within this space is Classified according to the /wiki/spaces/ISMS/pages/739344530 as |
INTERNAL |