SEO Tags and Other Head Entries
The tags in the <head> container of the page are managed in the templates. The methods that are listed below are available via the $this
context, because all template files are linked inside the linking methods of the cmsTemplate class object. Herewith, you can certainly request the specified methods in the context of actions and methods of a controller via $this→cms_template
too and get the template’s object via the $template = cmsTemplate::getInstance();
singleton in general cases.
$this->setPageTitle($pagetitle);
Sets the page title (<title> tag). If several arguments have been passed, it joins them into one string with delimiter ·
in between. If an array of titles has been passed, it joins the values into one string too, but with the «whitespace» delimiter in between. If the «Append site name to the page title tag» option is enabled in the site settings, the site name will be appended to the specified title.
$this->setMeta($keywords, $description);
Sets the keywords and description meta tags for the page. The $keywords
and $description
variables should contain a string ready for output.
$this->setPageKeywords($keywords);
Sets the value of the keywords meta tag.
$this->setPageDescription($description);
Sets the value of the description meta tag
$this->addHead($tag, $is_include_once=true);
Adds a random HTML tag to the head section of the page. $tag variable - tag’s HTML code. If the $is_include_once variable is set to true, the tag will not be linked twice (default behaviour).