Re: [phpslash-users] Happy New Year... But there is something thatI'm not getting...
Brought to you by:
joestewart,
nhruby
From: nathan r. h. <nh...@ar...> - 2001-01-04 20:06:38
|
On Thu, 4 Jan 2001, Mike Gifford wrote: > Hi Ajay & co, > > I'm hacking away at the templates for PHPSlash .6rc4 and I am getting > stumped by a couple of things. > > First, I'd like to know if someone knows about a general resource to > turn to to get the general feel of templates. We're talking about 'fast > templates', right? So is this a good starting point? I just found it > on the web: > http://curtisonline.net/theme/phpfast-templates-HOWTO.html > Actually phplib templates, but the premises are the same. http://phplib.netuse.de for more detailed info > 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... //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); > 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} > > is getting in my way... > Those are the placeholders, they are substituted out for the actual varibles in the php script by the template engine. 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.) > Thanks! > > 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. > > > -- ........ nathan hruby Webmaster: UGA Department of Drama and Theatre Project Maintainer: phpSlash, Carousel nh...@ar... ........ |