Re: [Phpslash-devel] Variables.class
Brought to you by:
joestewart,
nhruby
From: Mike G. <mi...@op...> - 2003-07-30 17:48:56
|
Howdy Joe, On Wed, 2003-07-30 at 04:40, Joe Stewart wrote: > On Tue, Jul 29, 2003 at 03:46:28PM -0400, Mike Gifford wrote: > > 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? > apache hanging was the worst. Otherwise, blank pages. That's not all that bad.. As long as it's not on a production server. > > > 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. Can't get much more flexible than that. > The header is just a block assigned to the section. Use a different > header template for different sections. Can you also specify other body & footer templates? > 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. That's a nice feature.. Folks liked the old single template/section from the old back-end.. > > > 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. Ok.. This is all definitely new since the last time I've looked (from the index.php) // add page output to be displayed $output .= $template->parse('OUT','index'); // add header if not parsed above in index page template if( !$template->is_available('index','HEADER')) { $output = $header . $output; } // add footer if not parsed above in index page template if( !$template->is_available('index','FOOTER')) { $output .= $footer; } So if you want to just use the single template you'd just comment out these lines: // get page header and footer $header = getHeader($pagetitle,$_PSL['metatags']); $footer = getFooter(); > Now there is a {TOP} and {BOTTOM}, so a footer can be in the CENTER or BOTTOM. Ok.. > > This hasn't been released yet.. Just in the standard CVS module at the > > moment, right? > phpslash-dev cvs module I was using phpslash-ft I'll just go and grab the development version.. Just having trouble grabbing things from the CVS at the moment.. Might be just something odd with the SF CVS server.. cvs -d:pserver:ano...@cv...:/cvsroot/phpslash login cvs [login aborted]: end of file from server (consult above messages if any) cvs -z3 -d:pserver:ano...@cv...:/cvsroot/phpslash co phpslash-dev cvs [checkout aborted]: end of file from server (consult above messages if any) > > 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'] > )); Great! That makes sense. > 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. So this should actually improve the performance to add it here.. > 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. Right.. > 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. Yes.. That's a nice feature.. 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 |