PDA

View Full Version : Navigation Template


odba
Tue 12th Dec '00, 8:28pm
I created a template called left nav that has a table with navigation. I tried including it in the left side of the page, I can see all formatting around it except the text of the template

<TABLE><TR><TD>
$leftnav
</TD><TD> ... rest of the stuff</TD></TR></TABLE>

If I just put some text instead of the name of the template, it works fine.

Any ideas.

dba

JimF
Tue 12th Dec '00, 9:03pm
Unfortunatly, creating a new template does not mean that it can be used as a variable in existing templates. The add template function is primarily used for multiple forum styles - so forum id 1 has the forumdisplay_1 template, forum id 2 has the forumdisplay_2 template, and so on. That's the bad news.

The good news, is that it is relatively easy to hack in a function to use your new template. This is the code you would insert into global.php:


// ####### Start Left Navigation Menu Hack #####

function leftnav("") {

// This is where you put all the variables that you use in your template

global $header,$footer,$cssinclude,$fivelinks,$forumjump, $timezone,$bbtitle,$hometitle,
$bburl,$homeurl,$copyrighttext,$privacyurl,$contac tuslink,$titleimage,$replyimage,$newthreadimage,
$closedthreadimage,$lastvisitdate,$timenow;

eval("\$returnval = dovars(\"".gettemplate("leftnav")."\");");

return $returnval;
}


That code is untested, and may not work as is. You may have to fool around with it a little bit to get it to work - or maybe someone here can tell you what you'd need to change.

This will get you going in the right direction, anyway.

-jim

Freddie Bingham
Tue 12th Dec '00, 9:11pm
leftnav("")

Are you trying to say that your function accepts no values?

Just use:

leftnav()

Mike Sullivan
Tue 12th Dec '00, 9:24pm
Actually, it would be simpler to just add this above the ?> in global.php:

eval("\$leftnav = \"".gettemplate("leftnav")."\";");

JimF
Tue 12th Dec '00, 9:32pm
Originally posted by freddie
Are you trying to say that your function accepts no values? [/B]

No, I was trying to say that odba could insert any values that were necessary for the menu, but I forgot to mention that.

Thanks for pointing out all my mediocrities ;)

At any rate, thanks freddie and Mike for helping out. I knew I could count on you :).


-jim