Re: [Back-end-development] Hello!
Joe Stewart <[email protected]> Thu, 31 Jul 2003 10:54:29 +0200
| Newsgroups | gmane.comp.cms.phpslash.devel |
|---|---|
| Message-ID | <[email protected]> |
Moved this thread to the phpslash-dev list.
Thanks to Dave for the constructive suggestions.
On Wed, Jul 30, 2003 at 11:02:10PM -0600, Dave Reid wrote:
> On July 30, 2003 06:45 am, Mike Gifford wrote:
> > This is phpSlash code, so I asked them about it:
> > http://sourceforge.net/mailarchive/forum.php?thread_id=2854114&forum_id=153
> >
> > Also asked them about your interest in passing along template variables.
> >
> > Apparently they've stopped using this class in an effort to cut down on
> > the number of db hits. Might re-introduce it and pass the variables
> > along through the session.
>
> That's an enlightening thread. The slashTemplate ctor set_var is a step in the
> right direction, though still hardcoded. A compromise would be for the
> slashTemplate ctor to do a set_var using some array that is set up in
> config.ini.php, to allow customization without changing slashTemplate itself.
This is a natural and useful extension. And pretty much exactly what you
can already do with the header templates. You can define an extra_ary and
either supply it directly to getHeader or _PSL and the getHeader function
will apply the array index as a template variable with the array value
substituted.
This could be added to apply generally to all template objects and would
be very welcome. I'm afraid I won't be able to get to it right away, but
if I find some time will get it committed to the phpslash cvs.
> In the long term it makes sense to me to go back to using DB variables, and
> cache them in the session.
>
> Passing extra block options to the template is a nice idea. I assume the
> "story options" Joe refers to are specific to phpSlash, with no BE
> equivalent?
>
> >
> > > > > Actually what I'd really like would be to have that, and to have one
> > > > > round of template substitution performed on section and maybe article
> > > > > content - I have had to hardcode references to the image dir in a few
> > > > > of these.>
> > > >
> > > > Not sure what you mean here.. You can already specify article/section
> > > > templates..
> > >
> > > Two examples:
> > > 1. I have sections that contain images from {IMAGEDIR} in their content.
> > > I could give each of those their own template and put the image and
> > > surrounding formatting in there instead, but then I have another template
> > > to edit if I rearrange the site, and content admins (who will NOT have
> > > template admin privileges) cannot change the images.
> > > 2. Content admins will upload images using the upload module, then create
> > > articles that refer to those images. I don't want to hardcode the path to
> > > the upload dir in those articles (that's brittle). It would be nice to be
> > > able to define variable UPLOADDIR = '/x/y/z/updir' and ref that in the
> > > articles.
> >
> > How would this be used in the site? Guess to just brand each section a
> > bit more strongly.
>
> For example 1, yes. To elaborate, I will have sections that have one or two
> separate parts of the page, with graphic headers. I want to use a common
> template and define those graphics in the page content.
>
> For example 2, the most common use is photos and PDF files that are
> associated with stories.
>
> It's not a big deal - I will just have to do a DB update if I ever move
> /images or /updir. it only occurred to me because {IMAGEDIR} is so
> handy in templates.
>
This is one of my uses for the story_options - to add extra story info (
associated image name in particular) without adding any database structure
changes.
Speaking of how phpSlash works, in most places, the {SKIN} variable can be
appended to the {IMAGEDIR} and then you can have separate graphic dir for
each skin. It sounds like you could use a different skin for certain
sections. This is not an ability in the current release, but is in the
-dev tree.
may have more - but gotta go now.
thanks,
Joe
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01