Log in

View Full Version : Variables in Templates


Link14716
11-18-2002, 09:48 PM
Ok, let's say I have this:

eval("dooutput(\"".gettemplate("site_templatename_v$v")."\");");

Ok, so that calls the right template, where $v is set either by user CP or the address bar.

But that makes the templates very unorganized. Say I want it like this:

eval("dooutput(\"".gettemplate("site_v$v_templatename)."\");");

It tries to parse a non-existing variable, $v_templatename.

How would I go about telling it to end it at $v and parse it correctly?

filburt1
11-19-2002, 01:13 AM
Quick and dirty:

..."site_v$v" . "_templatename)."...

i.e. break up the string.

Link14716
11-19-2002, 01:44 AM
Thanks filburt, forgot about trying that. Actually never thought of it. ;) Works perfectly :D