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.

Get Running Weblogs with Slash now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.