Re: [Phpslash-devel] Variables.class
Brought to you by:
joestewart,
nhruby
From: Joe S. <joe...@us...> - 2003-07-30 15:41:13
|
On Tue, Jul 29, 2003 at 03:46:28PM -0400, Mike Gifford wrote: > Hi Joe, > > On Tue, 2003-07-29 at 07:14, Joe Stewart wrote: > > > Speaking of modules, how is the phpSlash modules code going? > > Mostly stable. There is so much flexibility that you can really screw > > things up. Not sure how I like this part. > > That's the trouble when you give folks enough rope to hang themselves > on. :) > > > Sometimes the bugs have been pretty harsh and unforgiving. > > How bad? Just nasty errors or no errors or worse lost data? > No lost data. apache hanging was the worst. Otherwise, blank pages. > > Sections can have different headers and skins. > > How did you set up the header customization? I'm not even sure where to > start digging.. Is this just built into the standard classes now? > > > If you don't use the TopicBar, you simply don't have that block. No worry > > about including the class, etc. > > There was some talk a while back about making everything a block.. Just > depends on how you want to stack them.. > Pretty much everything is a block. The header is just a block assigned to the section. Use a different header template for different sections. So, those that wanted a more monolithic index page ( header and footer included) so that html editors view the entire page can do that too. > > You can have different footers for the two or three column page. This is > > important for all CSS pages ( no tables). > > Hm.. We haven't incorporated that piece yet.. But can't that all be > done in the index1col -> index3cols templates? > If you look at the index1,2&3 there is no reference to a footer, it was added by the index page. Tableless design using CSS only seems to have footer problems when the length of the side columns sometimes might be longer than the center column. This was noted by the Wired.com folks in their move too. Now there is a {TOP} and {BOTTOM}, so a footer can be in the CENTER or BOTTOM. > This hasn't been released yet.. Just in the standard CVS module at the > moment, right? > phpslash-dev cvs module <snip> > > So what needs to be done to allow template variables to be accessible in > any template? > To add certain variables to any template add something like this to the slashTemplate constructor: $this->set_var(array( 'QUERYSTRING' => $_SERVER['QUERY_STRING'], 'SITE_NAME' => $this->psl['site_name'], 'SITE_OWNER' => $this->psl['site_owner'], 'SITE_SLOGAN' => $this->psl['site_slogan'], 'SITE_TITLE' => $this->psl['site_title'], 'ROOTDIR' => $this->psl['rooturl'], 'IMAGEDIR' => $this->psl['imageurl'], 'SKIN' => $this->psl['skin'] )); Then we could get rid of setting the IMAGEDIR and ROOTDIR all over the place. There is some cleanup needed like ROOTURL/ROOTDIR, IMAGEURL/IMAGEDIR. I've experimented with only using one template instance. However, it was not faster in my limited tests. We use some common template variable names in multiple templates. This is used for repeating template blocks ( not phpSlash blocks ). i.e. BEGIN row, END row, etc. On one hand this is good because it simplifies use. However, you have problems doing this if you have only one template instance. Story and block options accept custom template variables also. If you add a block or story option that is not recognized, it is passed to the template as a variable. If there is one always needed, add it as a default option. Joe > Mike > -- > Mike Gifford, OpenConcept Consulting > Free Software for Social Change -> http://www.openconcept.ca > Site Launch - Make Every Vote Count - http://www.fairvotecanada.org > The cruelest lies are often told in silence. -- Robert L Stevenson > > |