2. Page Design Tags
Prev | Chapter 7. Tag Library | Next

## 2. Page Design Tags

### 2.1. setlocale

Sets a locale that will be used in the page. Other MeshCMS components will refer to that locale to display some string such as dates, mail form field names and so on.

Attributes:

- `value`: the locale name. Please note that this attribute is not required. If not provided, it will be searched in the path of the requested page, starting from left to right. For example, if the URL is `http://www.site.com/web/en/products/index.html`, the locale will be set to ``en``. If no valid locale is found in the page path, no locale will be set;

- `defaultValue`: same as `value`, but will be set only if not found in the URL;

- `redirectRoot`: if `true`, and if a language is available, the root page is automatically redirected to one of the language roots.

### 2.2. defaultcss

Creates a link to the default style sheets for that page and for the additional. You can use it (recommended) or import/link styles as usual. This tag has no attributes.

### 2.3. contextpath

Inserts the context path, i.e. the value of `HttpServletRequest.getContextPath()`. Useful for absolute paths, since the context path might be added when the web application context is not root in its host. This tag has no attributes.

Example 7.1. An absolute link

    <a href="<mesh:contextpath />/dir/page.html">An absolute link</a>

### 2.4. themepath

Inserts the complete path of the directory that contains the current theme. Very useful to insert files of the theme itself. This tag has no attributes.

Example 7.2. Insert an image located in the theme directory

    <img src="<mesh:themepath />/logo.jpg">

### 2.5. adminpath

Inserts the complete path of the admin directory. This tag has no attributes.

### 2.6. searchfile

Finds a file by name in the page directory, going up to the root until the file is found.

Attributes:

- `name`: the file name (required);

- `defaultName`: a default file to be used if the searched file is not found. This default file is supposed to exist in the theme directory;

- `include`: if `true`, the contents of the file are included, otherwise the file path is inserted.

Prev | Up | Next
1. Mandatory Tags | Home | 3. Page Elements Tags