How Information Is Displayed
All of the HTML rendered in user agents comes from templates. Templates
themselves are the core of the display system, determining the look and feel of
the site. Template logic all lives in the
Slash::Display module and the
slashDisplay function, which are described in Section D.4 in Appendix D. Templates are called either directly from
applets or from widgets. Widgets are a holdover from earlier versions of
Slash (found in the Slash module, where elephants
go to die). In modern versions, widgets are used only for drawing boxes with
the fancybox template. For example, to draw a sidebar box on a
page, use the Slash::templatebox function, passing the
name of the template to use. Similar calls exist for creating Poll Booth and
portald Slashboxes.
To improve performance, templates are compiled and cached. The cache keeps
only a set number of compiled templates in memory. This can be controlled by
the template_cache_size configuration variable. One final
note: the template language attribute is currently unused. It is intended to
support internationalization, which is not yet complete.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access