There are a few standard sub-directories contained within the /views/themes/THEME_ALIAS/ directory as explained in the below table.
In the /sections/ sub-directory you will place all section files, which are basically chunks of HTML that are included on multiple pages. This always includes the header.tpl and footer.tpl files, but can also include any other files you would like such as for example, search_bar.tpl, right_sidebar.tpl, etc.
Inside the /layouts/ directory is where all page layouts will be stored. There must be a default.tpl file, and any other layouts can be named anything you wish, such as for example, right_sidebar.tpl, gallery.tpl, etc. You can then specify which layout to use for each page of the web site via the CMS->Pages menu of the administration panel. Any pages without a layout defined will use the default.tpl layout.
Here's an example of a small layout file:
The above layout simply includes the header.tpl and footer.tpl files from the /sections/ directory, and the page contents is then replaced with the middle tag. It's simple as that. Then for example, you may want to create a layout that splits the page into a sidebar and main contents, then include a sidebar.tpl section file within the sidebar.
This is an important file, and contains the HTML blocks of all elements and widgets that are used throughout the software including navigation menu, tab controls, data tables, form fields, and so on. The default tags.tpl file should work with any typical Bootstrap theme, but you may wish to modify as needed for theme specific CSS elements. When Apex is parsing a template, it will use the HTML code within this file to generate the various elements and widgets. The file itself is very well documented, and should be quite straight forward.
Special HTML Tags
There are a few special HTML tags available you will want to use within your layout files, as explained in the below table.
The below merge fields are available system-wide and help personalize the site to the client's business. The values of these fields are defined within the Settings->General menu of the administration panel, and should be self explanatory.
Need a Professional?
Need development work by the creator of Apex? E-mail firstname.lastname@example.org for a free consultation.
Subscribe to the low traffic mailing list to stay updated on Apex.