[geeklog-modules] Center block API

geeklog-modules-admin at lists.geeklog.net geeklog-modules-admin at lists.geeklog.net
Thu May 22 17:08:12 EDT 2003


Center block API, again ...

I decided the best way to come to a decision would be to try and
implement the new API so that I could play around with it a bit.

The first thing I noticed is that the idea of having a $_CONF option for
"nonews" (i.e. whether news should be displayed on the frontpage or not)
has a problem: Suppose I wanted to display a "splash screen" to anonymous
users and the normal index page to logged-in users. You can't do that
with a global setting ...

So I went back to my previous idea and implemented an extra mode for the
center block call where the plugin has the chance to replace the
frontpage entirely.

Actually, there's a slight difference between these two things: One is
that you want to be able not to display news on the front page and the
other is to have an option such that a plugin can "take over" the
frontpage. But I couldn't think of a good way to make that configurable.

So what I've implemented now are the 4 modes for PLG_showCenterblock, as
mentioned before (top of page, after the featured story, bottom of page,
take over frontpage). I've also implemented a buffered version of
PLG_showCenterblock (i.e. it only does one MySQL request and re-uses the
result on the subsequent calls), removed the "static pages on frontpage
hack" from index.php and implemented the center block API in the static
pages plugin instead.

The new functionality of the static pages is currently as follows:

- label equals "frontpage": will be displayed above the stories when no
topic is selected
- label equals "topic:topic-id": will be displayed above the stories when
the topic with that topic-id is selected
- label equals "nonews" and no topic selected and it's page #1: take over
the frontpage entirely

Note that I moved the keywords to the label (from the title of the static
page). I'm thinking about adding extra field to the plugin and let you
select the topic from a drop-down menu (similar to what we have for
blocks). Also missing is the ability to display static pages after the
featured story and at the bottom of the page. That, too, would require a
new field in the database.

Consider the current implementation (in CVS now and soon in the nightly
tarball) a request for discussion, not a final implementation ...

bye, Dirk


-- 
http://www.haun-online.de/
http://www.macosx-faq.de/




More information about the geeklog-modules mailing list