Learn

Fruml Documentation...

Understanding Fruml Tags

Fruml Tags provide the mechanism whereby Fruml adds content into your templates. A tag amost always contains a `name` attribute which is used to identify the content being requested by the tag, and any number of optional attributes used to influence the manner in which the output of the tag is rendered. The following list shows the available tags and the attributes they can use. The order in which the tags are presented here represents the order in which they are parsed when a page is rendered (although this order can be edited in the 'Content Providers' functionality within Fruml).

The following tags are available:

[setting name="setting_name"]

The setting tag is used to write the value of system settings into the page. An example here might be:

<p>Send your e-mails to: <a href="mailto:[setting name="mail_sender_address"]">[setting name="mail_sender_name"]</a>. No spam please!</p>

This would output something similar to:

<p>Send your e-mails to: <a href="mailto:bob@example.com">Bob</a>. No spam please!</p>

Attributes available for this tag:

[page name="field_name"]

The page tag outputs a bit of page content. The fields available are all the standard content fields as well as all custom fields assigned to the page's page type.

<!DOCTYPE html>
<head>
    <title>[page name="page_title"]</title>
</head>
<body>
    [page name="page_content"]
</body>
</html>

The example displayed above outputs the `page_title` and `page_content` fields. Depending on the type of content stored in field, additional text or image transformations can be applied.

Attributes available for this tag:

[plugin name="plugin" method="method"]

This tag calls a plugin and is replaced by the output returned from the method called on the plugin.

If you wish, the function can be used as an alias of the method attribute ([plugin name="plugin" function="method"]). Any other attributes in the Fruml tag are passed to the method as an associative array.

Attributes available for this tag:

[component name="component_name" foo="bar"]

This tag calls a component and is replaced by the output returned from the component.

Any extra attributes defined in the Fruml tag are available in the component as variables (e.g. variable foo will be defined with the value bar).

Attributes available for this tag:

This tag generates a URI to another page within Fruml. The link can use an page identifier or a page id. To link to a page in another site in Fruml, you can optionally supply the site id. An example:

<a href="[link name="home"]">Home Page</a>
<a href="[link name="about" site="3"]">Home Page in another site</a>

The above code might render something similar to the following output:

<a href="/">Home Page</a>
<a href="http://localhost/about.html">A page in another site</a>

Attributes available for this tag:

[media name="media name"]

Embeds a media item into your page. Output depends on several factors, including the content type of the media item and the combination of tag attributes.

[media name="Photo" modify="PrettyPicture"]

The above example might output something similar to the following:

<img src="/cms/cache/img/a/ad657553f5651f600fb46fa5caab58f8.jpg" alt="A photo" height="150" width="200" />

The file referenced in the src attribute of the img tag is a transformed version of the original media item called 'Photo'. In this case, the transformation 'PrettyPicture' has been applied.

Attributes available for this tag:

[dict name="phrase name" book="dictionary" lang="language/ locale"]

This tag outputs a dictionary entry, identified by the 'name' attribute. To specify which dictionary should be queried, the optional 'book' attribute can be supplied (if no 'book' is specified, the system will try to look for a dictionary called 'Default'). The language of the entry to retrieve can be selected using the 'lang' attribute. If no 'lang' attribute is specified, the system will search for an entry using the currently selected language (note: language/ locale selection is not yet available in the front renderer, only in the CMS itself - this will be resolved in a future release).

[dict name="aboutus"]
[dict name="aboutus" lang="nl_NL"]

The above might output something similar to:

About Us
Over ons

Attributes available for this tag:

[resource name="resource name"]

This tag returns the path the visitor's browser should use to request Stylesheets or JavaScript libraries managed in Fruml. For example:

<link rel="stylesheet" type="text/css" href="[resource name="styles.css"]" />

This tag would output something similar to:

<link rel="stylesheet" type="text/css" href="/cms/resource/fetch/styles.css]" />

Attributes available for this tag: