B..2 Boxes generating the main page content

Some boxes can generate the main page content and fill in the CONTENT special key on a page template. These boxes are saved in the Boxes Admin Tool (A.11) by copying and pasting the code into the form and saving the new box. Once saved, they are activated in the Ops Admin Tool (A.16).

Create a new, appropriately named op, and fill in the form in a way that makes sense to the box. For example, while most pages use default_template as their page template, something like the faq_display box may be better suited to using index_template, which is used for the front and section index pages. Similarly, if the box is for general use, it probably doesn't need a permission associated with it.

Enter the name of the box in the `function' field and mark that this op is, in fact, a box.

If the box takes any parameters, these should be entered in the URL templates field. Using the faq_display box as our example again, the URL template would be:

/section/

This URL template indicates that the box takes the CGI parameter named `section' as its first pseudo-subdirectory; visiting the URL /faq/help will display the section named `help' using the faq_display box. This will allow you to display any of the existing sections using the faq_display box, actually.


janra
2004-03-26