I can't seem to get my custom field data to show up in Smarty entries. I have it set up to parse Smarty within entries, and I have the extended properties cache turned off. So if I name a custom field "Test", and then try to call it with {$entry.properties.ep_Test}, it doesn't output anything.
Also, is there a way to nest Smarty functions? Say I have a function Test1($var1) and I have it set up as a Smarty function and I want to put the value from {Test2} into it. Is this possible?
Problems using Smarty code in entries (custom fields)
-
dakotaroar
- Regular
- Posts: 21
- Joined: Thu Nov 08, 2007 3:30 pm
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Problems using Smarty code in entries (custom fields)
Hi!
Where do you use the {$entry.properties.ep_Test} variable? Inside your entries.tpl file? There it should work!
Or do you mean by using the smarty markup plugin? There you need to use {$eventData.properties.ep_Test} I think. Try {$eventData|@print_r} to see which variables you have.
but you cannot do this:
For that, have a look at the {capture} command, or you need to use {php} tags.
Regards,
Garvin
Where do you use the {$entry.properties.ep_Test} variable? Inside your entries.tpl file? There it should work!
Or do you mean by using the smarty markup plugin? There you need to use {$eventData.properties.ep_Test} I think. Try {$eventData|@print_r} to see which variables you have.
Can you be more specific? You can do this:Also, is there a way to nest Smarty functions? Say I have a function Test1($var1) and I have it set up as a Smarty function and I want to put the value from {Test2} into it. Is this possible?
Code: Select all
{my_smarty_func var1=$var2}
Code: Select all
{my_smarty_func1 var1={my_smarty_func var1=$var2}}
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
dakotaroar
- Regular
- Posts: 21
- Joined: Thu Nov 08, 2007 3:30 pm
{$eventData|@print_r} gives me '1' as an output.
Yes, I am trying to use the Smarty tags within the entry body, and I have installed the Smarty Markup Plugin and everything is turned on.
If I try putting {$entry.properties.ep_Test} in entries.tpl, it outputs '0' even when there is a value in the 'Test' custom field.
Thanks for the help on the Smarty functions, but where are 'var1' and '$var2' coming from?
Yes, I am trying to use the Smarty tags within the entry body, and I have installed the Smarty Markup Plugin and everything is turned on.
If I try putting {$entry.properties.ep_Test} in entries.tpl, it outputs '0' even when there is a value in the 'Test' custom field.
Thanks for the help on the Smarty functions, but where are 'var1' and '$var2' coming from?
-
dakotaroar
- Regular
- Posts: 21
- Joined: Thu Nov 08, 2007 3:30 pm
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Which other event plugins are you using?
Try
{$GLOBALS|@print_r}
within the entry body to see all available variables, somewhere there should be the properties array...?
Regards,
Garvin
Which other event plugins are you using?
Try
{$GLOBALS|@print_r}
within the entry body to see all available variables, somewhere there should be the properties array...?
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
dakotaroar
- Regular
- Posts: 21
- Joined: Thu Nov 08, 2007 3:30 pm
{$GLOBALS|@print_r} outputs "1" as well. I tried it on the fresh install and it doesn't work there either.
My event plugins are:
[C] Markup: Serendipity
[C] Markup: Emoticate
[C] Markup: NL2BR
Browser Compatibility
[C] Spam Protector
[C] Static Pages
[C] Show links to services like Digg, Technorati, del.icio.us etc related to your entry.
[C] Markup: Smarty Parsing
[C] Extended properties for entries
My event plugins are:
[C] Markup: Serendipity
[C] Markup: Emoticate
[C] Markup: NL2BR
Browser Compatibility
[C] Spam Protector
[C] Static Pages
[C] Show links to services like Digg, Technorati, del.icio.us etc related to your entry.
[C] Markup: Smarty Parsing
[C] Extended properties for entries
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Ah, it might be that I wrongly used the syntax, does {$GLOBALS|print_r} work?
In your usage case, it might be that you need to move the Smarty-markup parsing plugin after the entryproperties plugin in the order of plugins.
Regards,
Garvin
Ah, it might be that I wrongly used the syntax, does {$GLOBALS|print_r} work?
In your usage case, it might be that you need to move the Smarty-markup parsing plugin after the entryproperties plugin in the order of plugins.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/