Welcome to Geeklog, Anonymous Sunday, November 24 2024 @ 08:04 am EST
Geeklog Forums
how do I get a template variable that is not set to not display this: {myvar}
joel goldstick
Anonymous
I am using Geeklog v 1.3?. Some of my pages have certain variables set, but others don't. They all use a master header.thtml, and although I believe there is a setting in the template code that ignores undefined variables, I think I have it set correctly.
15
12
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
The option for unknown variables can have one of three values: "keep" (so that they show up when not set), "remove", and "comment" (i.e. keep them as comments in the HTML source, but they won't be visible).
The default it "remove". However, that will only come into effect when you call the finish() method for a template. We had a few places in Geeklog (until recently) where we called parse() but not finish(), and so the undefined variables were not removed.
bye, Dirk
The default it "remove". However, that will only come into effect when you call the finish() method for a template. We had a few places in Geeklog (until recently) where we called parse() but not finish(), and so the undefined variables were not removed.
bye, Dirk
6
9
Quote
Joel Goldstick
Anonymous
My code fragment:
...
...
$display .= COM_endBlock();
$display .= COM_siteFooter();
echo $display;
So, where would I go to invoke finish()
Text Formatted Code
...
...
$display .= COM_endBlock();
$display .= COM_siteFooter();
echo $display;
So, where would I go to invoke finish()
13
12
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Okay, maybe I misunderstood your question then. Are you trying to define your own variables? In one of Geeklog's templates or in one of your own?
To add your own variables to (some) of Geeklog's templates, there's the CUSTOM_templateSetVars function (in lib-custom.php), but that was only introduced around Geeklog 1.4.0.
bye, Dirk
To add your own variables to (some) of Geeklog's templates, there's the CUSTOM_templateSetVars function (in lib-custom.php), but that was only introduced around Geeklog 1.4.0.
bye, Dirk
8
9
Quote
All times are EST. The time is now 08:04 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content