Welcome to Geeklog, Anonymous Tuesday, November 26 2024 @ 04:47 pm EST
Geeklog Forums
add to Caching Template Library wiki
Status: offline
ivy
Forum User
Full Member
Registered: 11/25/04
Posts: 314
Location:Tokyo Japan
http://wiki.geeklog.net/index.php/Caching_Template_Library
I can't search that theme var can be used in PHP as bellow.
e.g.
echo $this->get_var('title');
?>
and we can't use theme var in PHP comment out area.
e.g.
// {title}
?>
Geeklog Japan https://www.geeklog.jp
I can't search that theme var can be used in PHP as bellow.
e.g.
Text Formatted Code
<?phpecho $this->get_var('title');
?>
and we can't use theme var in PHP comment out area.
e.g.
Text Formatted Code
<?php// {title}
?>
Geeklog Japan https://www.geeklog.jp
25
12
Quote
Status: offline
Laugh
Site Admin
Admin
Registered: 09/27/05
Posts: 1470
Location:Canada
That should work as long as you put that php code in a template that can access that template variable. I can't remember if php is executed first but this may work as well:
<?php
echo '{title}';
?>
One of the Geeklog Core Developers.
Text Formatted Code
<?php
echo '{title}';
?>
One of the Geeklog Core Developers.
22
15
Quote
Status: offline
ivy
Forum User
Full Member
Registered: 11/25/04
Posts: 314
Location:Tokyo Japan
Tom
thanks!
However, this code does not work on my test site.
echo '{title}';
?>
error:
Parse error: syntax error, unexpected T_STRING in /xxx/data/layout_cache/english_utf-8/denim__databox__templates__data__test2__list_detail.php on line 105
or
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /xxx/data/layout_cache/english_utf-8/denim__databox__templates__data__test2__list_detail.php on line 105
Geeklog Japan https://www.geeklog.jp
thanks!
However, this code does not work on my test site.
Text Formatted Code
<?phpecho '{title}';
?>
error:
Parse error: syntax error, unexpected T_STRING in /xxx/data/layout_cache/english_utf-8/denim__databox__templates__data__test2__list_detail.php on line 105
or
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /xxx/data/layout_cache/english_utf-8/denim__databox__templates__data__test2__list_detail.php on line 105
Geeklog Japan https://www.geeklog.jp
13
15
Quote
Status: offline
Laugh
Site Admin
Admin
Registered: 09/27/05
Posts: 1470
Location:Canada
I am surprised this is not working
echo $this->get_var('title');
When testing php in templates (or doing any template modifications) you should make sure template caching is disable as you maybe viewing a cached file instead of the actual file.
One of the Geeklog Core Developers.
Text Formatted Code
echo $this->get_var('title');
When testing php in templates (or doing any template modifications) you should make sure template caching is disable as you maybe viewing a cached file instead of the actual file.
One of the Geeklog Core Developers.
14
30
Quote
Status: offline
ivy
Forum User
Full Member
Registered: 11/25/04
Posts: 314
Location:Tokyo Japan
Text Formatted Code
echo $this->get_var('title');It works correctly. but I can't find in Wiki.
So please add.
Geeklog Japan https://www.geeklog.jp
16
16
Quote
Status: offline
ivy
Forum User
Full Member
Registered: 11/25/04
Posts: 314
Location:Tokyo Japan
Thanks!
this notice is not needed?
notice: theme variable {xxxxx} can not be included in any comment area.
e.g.
<?php
// {xxxxx}
?>
Geeklog Japan https://www.geeklog.jp
this notice is not needed?
notice: theme variable {xxxxx} can not be included in any comment area.
e.g.
<?php
// {xxxxx}
?>
Geeklog Japan https://www.geeklog.jp
14
15
Quote
All times are EST. The time is now 04:47 pm.
- 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