Container

From The Smartest Wiki
Jump to: navigation, search

A container is a point in a template where another template can be chosen, and then included in a page. This gives the user control over a page's layout without the need to modify any code, as long as templates exist that are suitable for the page.

In more orthodox language, a container is a user-definable server-side include, primarily used for the purposes of document layout, where the file that is included can be selected via a user interface, and be different from page to page.

The template included in a container is said to be the template with which the container is 'defined'.

A small tag within a template tells Smartest to include a container template selected by the user.

The markup for a container tag looks like this: <?sm:container name="CONTAINERNAME":?>

The templates that are included by a container are called container templates.

Adding containers

To add a new container, add a container tag to one of your existing page master templates or container templates:

<?sm:container name="CONTAINERNAME":?>

Primary container

On each website, one container can be nominated as the website's primary container, meaning that its role in determining the overall layout of pages can be stored in the system, and the container can be presented to the user as page layout.