Name

slashDisplay — processes and displays (or returns) a named template

Synopsis

slashDisplay($templatename, \%values);
slashDisplay($templatename, \%values, \%options);
my $page = slashDisplay($templatename, \%values, \%options);

This function is the heart of Slash’s powerful template system. It fetches the appropriate template based on user access, preferences, and form values; processes the template based on the values; and either prints it to the user or returns it to the calling code. The first parameter is a string containing the base name of the template. The second parameter is a hash reference of variables and values to pass to the template, as described in Appendix C. The third parameter is optional. If provided, it must be a hash ref. Valid keys are:

Return

If true, returns the processed template data instead of printing it. The default is false (print the data).

Nocomm

If true, does not include HTML comments to identify the processed template. The default is false (print the comments).

Section

Prefers a template from the provided Section, overriding the user’s current Section. The default Sections are default and light. This unfortunately named option has very little in common with Story Sections. If an invalid Section or a Section of NONE is provided, Slash will use default instead.

Page

Prefers a template associated with a page other than the user’s current page. By default, a user accessing the users.pl applet is considered to be on the users page. If the selected page ...

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.