- Home
- Categories
- Settings
- Themes
- Templates
- Page template
Page template
This article is a translation of article in russian.
Pages' templates are stored in tpl/pages/ folder. Each page has its own template.
Page template renders a whole page. However there are Layout templates to simplify editing. Layout template renders page layout and inserts in specific place main content provided by page template. To do so whole page template is wrapped in <UH-Page> component.
The usage of <UH-Page> component is not required. Without it you will need to write ull page murkup beginning with <!DOCTYPE html>, which is annoying due to large number of different pages.
Component <UH-Page>...</UH-Page>
As is said above, the component renders page layout using its body as main content of a page (which can be rendered in layout template with <UH-Content/> component).
Properties:
- layout (string): layout template name. Name must to omit tpl/layouts/ folder and.tpl extension, t.i. layout tpl/layouts/foobar.tpl will be referred as foobar. By default default.tpl template is used;
- options (string): enables specified options in layout to use in <IfOption> component. Names are separated by comma and/or space.
Example of usual page which uses default.tpl without any options.
<UH-Page> <p>I'm very useful content.</p> </UH-Page>
Example of a page which uses layout foobar.tpl with options lorem and ipsum enabled.
<UH-Page layout="foobar" options="lorem, ipsum"> <p>I'm very useful content.</p> </UH-Page>