Scoop -- the swiss army chainsaw of content management
Front Page · Everything · News · Code · Help! · Wishlist · Project · Scoop Sites · Dev Notes · Latest CVS changes · Development Activities
Relationship between boxes, templates and blocks? Boxes
By slinberg , Section Help! []
Posted on Fri Mar 16, 2001 at 12:00:00 PM PST
Can someone explain how boxes, templates and blocks are related? (Problem description in extended copy...)

I imported Rusty's code to do the diary and story listings in a box on the front page, but I think I put the code in the wrong place... first in a block, rather than a box, and I had them both named sec_story_box... I'm confused enough about the process that I can't even articulate exactly what I did.

Last night it started crashing scoop with the following error, although it had been working for a while and I don't think I changed anything in the past week:

[Thu Mar 15 21:19:29 2001] [error] Undefined subroutine &Scoop::BOXES::foo::sec_story_box called at /usr/local\/scoop/lib/Scoop/Boxes.pm line 40.

("foo" is the name of the site - not quite ready for public eyes yet :)

The only way I could fix it was to remove the entry referring to it in the index_template block, but I wonder if some of the problem was that I didn't understand where to put the code and how to properly reference it from a block.

I'm also confused by the function of the "template" menu on the Boxes page. What does it do?

Thanks for any tips.
< Who is online? | cabal_box >

Menu
· create account
· faq
· search
· report bugs
· Scoop Administrators Guide
· Scoop Box Exchange

Login
Make a new account
Username:
Password:

Related Links
· Scoop
· More on Boxes
· Also by slinberg

Story Views
  35 Scoop users have viewed this story.

Display: Sort:
Relationship between boxes, templates and blocks? | 4 comments (4 topical, 0 hidden)
this is how I think of it (5.00 / 1) (#1)
by hurstdog on Fri Mar 16, 2001 at 02:56:52 PM PST

I use boxes for fully dynamic content, blocks for stuff that is mostly html that will change, but that I can just put in a |CONTENT| or |BOX,foo,bar| into it to get the changing parts, and special pages for stuff that doesn't change at all. Vars are for site configuration, and we're working on moving all vars that deal with fonts, display, etc.. into blocks. Now templates:

Templates just specify which block to use to show a page for a particular op. templates are blocks. But they are blocks with _template after the block name. like index_template etc. What you're doing at the template admin tool menu is specifying which template to use for which operation. So default_template for op=view_poll, story_template for op=displaystory, and so on.

Boxes have thier own sort of template too, really just a default box. These are blocks with _box after their name. So blank_box can be used as a container of sorts for displaying all of the info that you generate with the perl in a given box. Just return a hash with all of the values to substitute, so 'return { content => "this is my box, there are many like it, but this is mine", title => "this is the title"} if you are using the regular 'box' template

There are also special pages. Special pages are just static pages. So anything that is more static than a block, I would put in a special page. Like FAQ's and mission statements, etc.

So does that cover it well enough? I just went over it pretty quick, there is someone working on docs right now, we should have a few in the 0.6 tarball. And as the docs become available, I'm going to put them on a special page here.



-hurstdog


Relationship between boxes, templates and blocks? | 4 comments (4 topical, 0 hidden)
Display: Sort:

Hosted by ScoopHost.com Powered by Scoop
All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest © 1999 The Management

create account | faq | search