skip to main content

kiesler.at

Understanding the Display Engine
updated by rck, 2004-11-15

Actually, one of the more powerful things in phpWebSite is the Display engine. A content management like phpWS does just that: It manages your content. I'll show you, how.

1 | 2 | 3 | 4 | 5 | 6

Box Styles

Box Styles are the optical connection between your sites design and it's content. What we do here is give every module a place, where it can "live" in. It's like parcelling land, if you'd think about your columns as land.

Most modules need to visually interact with the user. That's, where the box comes in -- it prepares a space on the screen for a module and optionally allows to define a title for it as well.

Boxes organize space of your site
box styles

Where to find them

Every theme needs a boxstyles/ directory. For each boxstyle you have, you have a .tpl file for it as well.

There are two special Boxstyles: default_box.tpl and default_pop.tpl. While I don't know exactly, what good the default_pop.tpl is, default_box.tpl is the default boxstyle for every box.

I add a void.tpl and a minimal.tpl to all my themes. void.tpl is a empty file; if I don't want to display some content in a certain theme, I'll give it the void boxstyle. If I just want to see the plain content, without any additional formatting, I'll give it the minimal style.

You can select different boxstyles for content via the layout manager in the control panel.

Why separate boxes from the rest?

Because it gives us even more flexibility. Think about, for example, a boxstyle called "optional". It would only display on big computer screens but not on handhelds. Things like the "popular article" list come to mind.

Then, boxes can be moved around in the layout manager. You have three columns and three vertical subdivisions, where you can freely move your boxes around in.

What to put in a boxstyle

A perfectly valid boxstyle, in fact that's the way I do most:

<h2>{TITLE}</h2>
{CONTENT}

That's it. No table, no (shudders!) bold / center tag, no inline style definition, nothing. Did you know, you can give most tags a distinct background, for example? Boxes with a header having a background are no problem.

You might want to add a style-class, where you put around a border. By the way, I usually use h2 for the main content box and h3 for the side boxes. h1 I reserve for the site heading

1 | 2 | 3 | 4 | 5 | 6



RSSComments - Make a comment
The comments are owned by the poster. We are not responsible for its content.
  • Great article!

    Posted on 2004-11-13 05:11:11 By aDarkling[2]

    Very Informative!

    Possibly too informative, though. It might be better to break this down 3 articles, like:

    Understanding the Display Engine
    Effective CSS with phpWebsite
    Writing good HTML for phpWebsite

    because there's so much to cover, like the /images directory, how templating tags work, necessary tags for theme.tpl, what theme.php is, etc..

    I'd like to see examples of what the theme.tpl looks like, like when you suggested using 2 .css files, there should be an example of how they are used.

    I like the analogy you used for Box Styles.
    "default_pop.tpl" has been obsolete since (I think) 0.9.1, but noone ever got around to deleting it.

    I haven't played around with templates in months, but as for module templates from the theme being loaded the second time they are used, you may want to try turning the cache off. I think the templates may either be stored in the cache or in session memory.

    Good job!
    I look forward to seeing where this goes!

    [Reply ]

    • Article Breakup

      Posted on 2004-11-13 12:24:13 By rck[110]

      Very Informative!

      Possibly too informative, though. It might be better to break this down 3 articles, like:

      Understanding the Display Engine
      Effective CSS with phpWebsite
      Writing good HTML for phpWebsite


      In fact, this was meant to be a overview article about all aspects of the display engine of phpWebSite. I've already tried to point out the things on writing good HTML in my Semantic Web article, which didn't have the impact I had thought.

      I too see the need for guidance of good CSS and HTML generally, as well as taylored for phpWebSite and think about articles on that all the time. As soon as I know, how I can sum that up nicely, I will do it. Suggestions are always welcome of course

      [Reply ]

    • Examples

      Posted on 2004-11-13 12:26:24 By rck[110]

      I'd like to see examples of what the theme.tpl looks like, like when you suggested using 2 .css files, there should be an example of how they are used.

      Did you check out the Autumn theme already? It's a pretty good example of what I'm writing about. When you open it's theme.tpl, you'll see three css links (standard.css, colours.css and layout_screen.css) that are exactly doing what I describe in that article. That theme could be easily extended with, say, layout_handheld.css, layout_audible.css, whatever.

      As soon as I have an idea of the outline, I will go into that in more detail in it's own article. Until then: Feel free to discuss it right here!

      [Reply ]

    • Templates load only the second time

      Posted on 2004-11-13 12:30:15 By rck[110]

      changed On 2004-11-13 17:33:23 Edited By rck (reason: luck vs. look)

      I haven't played around with templates in months, but as for module templates from the theme being loaded the second time they are used, you may want to try turning the cache off. I think the templates may either be stored in the cache or in session memory.

      I've already turned off caching in the phpWebSite config. While it helps overall performance, it doesn't change this issue, as far as I can tell. Even if I do shift-reload pages in my browser (which in fact shouldn't be neccessary with the right http-headers), I still get the templates only the second time

      It must be some kind of caching issue, but I don't know where to look. Maybe appstate or someone else can gain some insight on this topic? I've read about people that have the same issue already, so I guess it should be reproducable.

      [Reply ]

    • Re: Great article!

      Posted on 2004-11-13 12:31:44 By rck[110]

      Very Informative!

      I like the analogy you used for Box Styles.

      Good job!
      I look forward to seeing where this goes!

      Thank you! It wouldn't be possible without your Article Manager... ;)

      [Reply ]

  • A Brave Step

    Posted on 2004-11-14 02:01:17 By Anonymous

    Good article, and probably the pilot of many more specific explanations. Well done and clears up a confusing area.

    quote
    I've already tried to point out the things on writing good HTML in my Semantic Web article, which didn't have the impact I had thought.
    unquote

    My opinion? There are many places pointing out good HTML etc but after unpacking phpws we tend to be more into getting the look together... if phpwebsite display/theming/customisation tutorials follow good practise we the flock will fall into line! You have the power - convert us!

    [Reply ]

RSSAll Articles
2008, 2007, 2006, 2005, 2004

What's Related

Article Manager

Tutorials

Latest Updates

AdministrativeTexts
updated by freddiemac1993, 2013-06-14
wiki

Re: adventures
created by brittdavis10, 2012-02-23 (1 rply, 3 views)
thread

Re: how to run phpwebsite...
created by alexander, 2011-08-25 (2 rpls, 3607 views)
thread

Re: Forum tags
created by HaroldFaragher, 2011-08-22 (3 rpls, 8488 views)
thread


Zu den KO2100 Foren