Hello Nathan,
"nathan r. hruby" wrote:
> Actually phplib templates, but the premises are the same.
> http://phplib.netuse.de for more detailed info
This documentation was more confusing than the code itself :)
However, I've started plugging through it and it starts to make more
sense now. Watching the source carefully helped track down where to
change the template.
I've got a version of phpslash-0.6-rc4 running here:
http://www.octopusbooks.ca/discuss/
I've added a OS dependent CSS sheet to header.. Looks fine in Linux,
but I've yet to bounce over to windows and see it there. Why was it
decided not to use CSS with phpslash?
> > Next, I wanted to know how the heck to you involve php scripts into
> > templates? I couldn't find that in the search engines..
> For example, this is a section from my index page for my new site...
Question at the bottom of this..
> //Set info to send to getStories()
> $ary = array('section' => 'Home', //Home section
> 'min' => '0', //start at the top
> 'max' => '1'); // go two items in
>
> $story_text = $story->getStories($ary); //get 'em into a var
>
> $template = new Template($templatedir); //start template engine
> $template->debug = 0;
> $template->set_file(array(
> index => "ds-index.tpl" //Use my new template
> ));
>
> //set the engine so it knows to parse above file for the following flags
> //(ie: {ROOTDIR} in the .tpl file and substitute them with the contents of
> //$rootdir
>
> $template->set_var(array(
> ROOTDIR => $rootdir,
> IMAGEDIR => $imagedir,
> STORY_COLUMN => $story_text
> ));
>
> // Parse
> $template->parse(OUT,"index");
>
> //Output the parsed template
> $template->p(OUT);
Ok.. This is useful.. However, templates, call templates (from what I
can tell). I just want to include a chunk of html from another file
using something like this:
<? include("nav.inc"); ?>
I'd like to include this in a sidebar that appears on all pages of the
site. Right now I'm just pasting in the html directly into the
slashHead.tpl however I'd just like to update one file & have consistent
navigation throughout the site.
Could I just revise the index.php3 :
$included_nav=include("nav.inc");
$template->set_var(array(
ROOTDIR => $rootdir,
IMAGEDIR => $imagedir,
STORY_COLUMN => $allstories,
BLOCK_COLUMN => $allblocks,
INCLUDED_NAV => $included_nav
));
and then be able to include this in slashHead.tpl:
{INCLUDED_NAV}
> > Finally, things don't quite seem to be quite appearing where I would
> > expect them to be. I'm starting with the slashHead.tpl file... But I
> > guess my not understanding what these codes do:
> > {TOPICBAR}
> > {NAVBAR}
> Those are the placeholders, they are substituted out for the actual
> varibles in the php script by the template engine.
Where can you see a list of all of the variables which are included?
{VARIABLE} could be either another template or a php outputed variable
can't it?
> Does that make sense? It's kinda tricky to wrap your head around the
> first time ("where are all the damn echo statement.. Jeeze!" was my inital
> reaction.)
Yup.. That was my initial reaction too...
Mike
> > Ajay Sharma wrote:
> > > I've actually started that this weekend and will probably write some
> > > tips about it. The one thing that's really important is that you have
> > > to setup the slashHead.tpl file to do everything before the story
> > > column, that include any opening <TD> lines. Once you do that then all
> > > the pages fall under the new template style. I like my new layout
> > > because the navbar is in left column, the stories in the middle, and the
> > > blocks on the right.
Any success with getting this finished over the weekend?
Mike
--
Mike Gifford, OpenConcept Consulting, http://www.openconcept.on.ca
Offering everything your organization needs for an effective web site.
Featured Client: http://www.arbourshop.com/
"Progress means advancing toward a more desirable form" - Gerar Toye
|