Skip to content
This repository has been archived by the owner on Aug 6, 2022. It is now read-only.

II.6.b. Homepage, F.A.Q. page, header, footer

Andrey Bogdanov edited this page Feb 24, 2016 · 4 revisions

ololord.js uses doT.js as a template rendering engine. Custom page conten is also rendered using this engine.

Home page

Create public/templates/custom-home.jst. It will be rendered as any other doT.js templates. See public/templates/custom-home.jst.example for an example.

Note: all templates must have only one root element. Just wrap everything in a div or a span.

F.A.Q. page

Create public/templates/custom-faq.jst. It will be rendered as any other doT.js templates. See public/templates/custom-faq.jst.example for an example.

Header and footer

Create public/templates/custom-header.jst and/or public/templates/custom-footer.jst. These templates will be rendered as any other doT.js templates. See public/templates/custom-header.jst.example and public/templates/custom-footer.jst.example for examples.

The content of custom header is wrapped in a header tag, and the content of custom footer is wrapped in a footer tag.

Note: Regardless of whether on not custom footer and header are provided, the corresponding tags will be present on the pages. The following styles are applied to them:

header {
    padding-top: 2px;
    padding-bottom: 8px;
}

footer {
    padding-top: 8px;
    padding-bottom: 2px;
}

So, to prevent empty tags occupy the space on your site pages, you may create dummy header/footer templates with the following content:

<div style="display: none;">
    <script type="text/javascript">
        $("header").hide(0); //jQuery is used
    </script>
</div>

or, for the footer:

<div style="display: none;">
    <script type="text/javascript">
        $("footer").hide(0); //jQuery is used
    </script>
</div>
Clone this wiki locally