PDA

View Full Version : disable certain templates


Johnny
09-28-2004, 07:23 PM
What im trying to do is call certain templates to be displayed in certain forums without using conditionals such as.

<if condition="$show and (in_array($forumid, array (X,Y)))"> $navbar </if>

but have something more like <if condition="$show[blah_template]"> $navbar </if>

(using $navbar template as an example)

im going to have too many forums and once i add more fourms just going back and adding a number to all the templates has thas the array conditionals that i dont want certain things to show in certain forums is just too much work.

so is their a way to do this as an option in admincp when editing or adding a new forum that gives an option if you want only enable/disable certain templates from showing in a particular fourm but not all

nexialys
09-28-2004, 07:28 PM
if you need the navbar to be disabled only, this is simple... no need to edit the template. in any script you want it to be managed with a conditional, just do like:if ($myconditional)
{
eval('$navbar = "' . fetch_template('navbar') . '";');
}

you just have to find all the eval containing the navbar.. this is where it is defined...

same thing for all the templates in the scripts...

Johnny
09-28-2004, 08:22 PM
edit: nevermind i figured it out at vb.com but thx for your help nexialys.