fm:PageTitle


The PageTitle component allows you to change the <title> of your html document from within your application template.
It allows you to change the browser's window or tab title. You could, for example, set it to the name of a media file you're looking at currently. This component is invaluable if you want to enhance your website's SEO.

Example

<fm:PageTitle>That's what she said!</fm:PageTitle>

The code above will output this:
a dynamically updated page title

Supported attributes

This component does not accept any attributes.

Template variables

fm:PageTitle produces a template variable in a different way than most others.
It populates the global {$pageTitle} variable, which should be placed in the <title> tag. See More examples below.

See also

More examples

The following code should be placed in the wrapper template that's used by the template you want to set the title with:

<head> <title>My application - {$pageTitle}</title> </head> <!-- this goes in the wrapper -->

The following code should be placed in your Application template. In this case, we're going to use a mediadetail page.
Make sure this template uses the right wrapper template (that includes the example above) to see it update the page title.

<fm:PageTitle>{$$media_title} by {$media_username} from {$media_user_city}</fm:PageTitle>