next up previous
Next: 3.12 Groups Up: 3 Administration Previous: 3.10 Boxes

Subsections


3.11 Templates

Templates are the basic framework for the pages Scoop generates. This is where you define the layout of your site. Scoop then fills in the content as required from the database. Different templates can be used for different opcodes (4 (NOTE: need something about ops)).


3.11.1 Usage

There are two places to go to edit templates: 'Templates', from the admin tools box, and in the block editor (link). Note that these two places have different purposes.

The template editor is used to assign templates to opcodes. This way, displaying a story (op=displaystory) can use a different layout than special pages (op=special) or section listings (op=section).

To fetch the name of the template a given opcode is assigned to, select that opcode from the "Op" drop-down box and click "Get Template". To change the template assigned to that opcode, change the template name selected in the "Template" drop-down box and click "Save Template".

To actually change the template layout itself, the block editor (3.6) is used. Templates are blocks named <name>_template - just edit them the way you usually edit blocks.


3.11.2 Notes

Be extremely careful when editing templates. If you mess up the one you use for op=admin, you may never be able to fix it, short of diving into the database. Apart from that, it's standard HTML with vars, blocks, and boxes inserted via |var_name| substitution.


3.11.3 Relevant Vars

Normal vars sitename, various font and bgcolor vars

Normal blocksheader, footer
Normal boxesany of them. Remember, though: these are not called simply by |some_box| like vars or blocks are because they contain code that must be run and the output inserted into the page. Boxes are called by |BOX,some_box| [[BOX LINK]].
Special vars: (These are generated by the Scoop code and do not show up in the site controls list)

subtitleThis is replaced with the site slogan for the front page, titles for story and poll display pages, and other such things as appropriate
CONTENTThis is replaced with the main content of the page being viewed: for the front page, this is the story title and first paragraph(s) for the first few stories.
STORYThis is replaced with the story being viewed (eg the story for op=displaystory or the poll graph for op=view_poll)
COMMENTSThis is replaced with the comments attached to the story being viewed.


3.11.4 Relevant Perms

edit_templates, edit_blocks


next up previous
Next: 3.12 Groups Up: 3 Administration Previous: 3.10 Boxes