Views ===== The template parser reads views from the ``view`` subdirectory of a gluon-web application (``/lib/gluon/config-mode/view`` for the config mode, ``lib/gluon/status-page/view`` for the status page). Writing own views should usually be avoided in favour of using :doc:`model` with their predefined views. Views are partial HTML pages, with additional template tags that allow to embed Lua code and translation strings. The following tags are defined: - ``<%`` ... ``%>`` evaluates the enclosed Lua expression. - ``<%|`` ... ``%>`` evaluates the enclosed Lua expression and prints its value. - ``<%=`` ... ``%>`` evaluates the enclosed Lua expression and prints its value *without escaping HTML entities*. This is useful when the value contains HTML code. - ``<%+`` ... ``%>`` includes another template. - ``<%:`` ... ``%>`` translates the enclosed string using the loaded i18n catalog. - ``<%_`` ... ``%>`` translates the enclosed string *without escaping HTML entities* in the translation. This only makes sense when the i18n catalog contains HTML code. - ``<%#`` ... ``%>`` is a comment. All of these also come in the whitespace-stripping variants ``<%-`` and ``-%>`` that remove all whitespace before or after the tag. Complex combinations of HTML and Lua code are possible, for example: .. code-block:: text