I wasn't sure where to put this so here goes, and yes I looked all over the net, php.net, php wiki, smarty etc. etc. tried taking out {} front back sideways, use [], and about 20 other ways to write it...
I have a spot in my template where I need to change a phone # by what section/parent they are under and I'm able to get the parent_page_alias to use it as a class on a div but I can't use it for a custom content block like so...
{global_content name="{nextup assign="parent_page_alias"}{$parent_page_alias}num"}
nextup is the name of a UDT I made for the parent alias and it works in the class call, but not inside of another Smarty tag...
This is how I do it in the class call...
class="{nextup assign="parent_page_alias"}{$parent_page_alias}
[solved] Smarty in Smarty
[solved] Smarty in Smarty
Last edited by Anonymous on Tue May 13, 2008 7:28 pm, edited 1 time in total.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Smarty in Smarty
You can't nest smarty tags.... smarty is smart, but not THAT smart.
The capture smarty plugin (it's in the smarty docs) allow you to capture anything between {capture assign='somevar'}whatever code I want including {$some_smarty_variable}{/capture} into a single smarty variable called (in this case) somevar.
so In your cased I'd do something like:
{capture assign='parent_page_alias'}{nextup}num{/capture}
{global_content name=$parent_page_alias}
btw... check out the CGSimpleSmarty Module, it has a function to get the parent page alias already.
The capture smarty plugin (it's in the smarty docs) allow you to capture anything between {capture assign='somevar'}whatever code I want including {$some_smarty_variable}{/capture} into a single smarty variable called (in this case) somevar.
so In your cased I'd do something like:
{capture assign='parent_page_alias'}{nextup}num{/capture}
{global_content name=$parent_page_alias}
btw... check out the CGSimpleSmarty Module, it has a function to get the parent page alias already.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Smarty in Smarty
Thanks it worked great...