Stationary articles (header, footer etc)

This sample shows how to create a stationary or sticky objects (articles, links etc) on a page. These are objects that appear in the same place no matter what section is currently selected, for example: footer articles or links.

The sample script is specifically about how to create footer articles that do not appear in site search, the same prinicple can be used for any stationary area or objects.

The principle behind is to have one specific parent that is always available but is different for every language that the site has and avoid any hardcoding of ID's. The script can be used in version 4.4.2 or higher.

{init_objects name="footer_articles" parent_system_alias="system" classes="article" position="75"}

{foreach from=$footer_articles item="articles"}
    {init_article name="article" id=$articles->id}
    <div>{$article->buttons}{$article->body}</div>
{foreachelse}
    {$footer_articles_newbutton}
{/foreach}

The parent_system_alias="system" puts the object under the System section of current language. The System section is always available and is a different for each language. Also objects under this section do not appear in the site search results or sitemap.

The position is used to keep articles (or other objects) apart from those already under that section. So for each case (footer, header, side banners) use different position.