About Download Docs Changes

template_example

Template Example

The Jinja2 templates allow Wiki pages to be customized. For example, a copyright notice can be added to the layout template and it will be displayed on all pages.

The templates can be found in hatta/templates/, in the directory where Hatta is installed. Version 1.5.3 contains 11 files, with the following hierarchy:

Copyright Example

Changes to the layout.html template will be inherited by all other templates. Near the bottom is something like:

</div></div>
    {% block scripts %}{% endblock %}
</body></html>

Change this to something like:

    {% block scripts %}{% endblock %}
    <div class="delude_copyright">
       {{ _("Copyright 2012, Delusion, Inc.  All rights reserved.") }}
    </div>
</body></html>

This example uses a custom CSS class. It should be added to the style.css page in the root directory. Example:

div.delude_copyright { font-size: 75%; text-align: center }

Edit Example

Changes to the edit_text.html template could be used to display disclaimers or hints, when pages are edited. Near the top is something like:

{% block content %}
    <form action="" method="POST" id="hatta-editor"><div>

Change this to something like:

{% block content %}
    {{ _('By editing this page, you affirm your folly.') }}
    {{ _('<br>For help editing, see Hatta Wiki markup\n') }}
    {{ _('<a class="special" href="/Markup" title="Markup">overview</a>,\n') }}
    {{ _('<a class="special" href="/MarkupSummary" title="MarkupSummary">summary</a> and\n') }}
    {{ _('<a class="special" href="/Markup2" title="Markup2">detail</a> pages.\n') }}
    <form action="" method="POST" id="hatta-editor"><div>

Edit Example

Changes to the edit_text.html template could be used to display disclaimers or hints, when pages are edited. Near the top is something like:

{% block content %}
    <form action="" method="POST" id="hatta-editor"><div>

Change this to something like:

{% block content %}
    {{ _('By editing this page, you affirm your folly.') }}
    {{ _('<br>For help editing, see Hatta Wiki markup\n') }}
    {{ _('<a class="special" href="/Markup" title="Markup">overview</a>,\n') }}
    {{ _('<a class="special" href="/MarkupSummary" title="MarkupSummary">summary</a> and\n') }}
    {{ _('<a class="special" href="/Markup2" title="Markup2">detail</a> pages.\n') }}
    <form action="" method="POST" id="hatta-editor"><div>