How to Format Dynamic Content?

Along with inserting dynamic content, you can convert it to HTML and apply formatting. For example, if information is stored as image link, instead of displaying the link, you may need to display as image itself.

1. Formatting Dates

In the database, the date is stored in the format "Y-m-d H:i:s". You can easily change the display format. For example:

{FIELD created|format:d M, Y}

2. Converting to HTML

Following HTML tags are supported: p, div, span, h1, h2, h3, h4, h5, h6, pre, ol, ul, table, a (for links), img (for images).

Additionally, you can add attributes except style attribute. For example, you can class to apply styling. For example:

{FIELD title|tag:h1;class:text-primary}

Other attributes that can be applied: id, title, custom data-* attributes, aria-* attributes.

HTML Lists

When data is stored as JSON, you can use ol or ul tags.

HTML Table

When data is stored as JSON as rows and columns, you can use table tag. For example:

{FIELD projects|tag:table;heads:Title,Description}

HTML Links

To convert data into link, use a tag. For example:

{FIELD url|tag:a;text:Click Me}

HTML Images

To convert image Url to actually display the image, use img tag. For example:

{FIELD image|tag:img;width:300;height:200}

3. Extracting Data from JSON

If multiple data is stored as JSON, you can extract a particular value. For example:

{FIELD params|type:json;key:image}