Page 1 of 1
attribute within another attribute
Posted: Tue Jun 29, 2010 7:18 am
by Supay
First: Sorry for my english

Second:
I need to introduce an attribute within another attribute
for example:
{Gallery dir='home/imagenes/XXX'}
{page_attr key="extra1"}
{page_attr key="extra1"} is XXX
The result: {Gallery dir='home/imagenes/{page_attr key="extra1"}'}
¿?¿??¿
which is the correct way to do this?
Thank you!!!
Re: attribute within another attribute
Posted: Tue Jun 29, 2010 3:41 pm
by Salketer
You can use the capture tag to assign the returned values in a variable and then use the variable.
Code: Select all
{capture assign='extra'}{page_attr key="extra1"}{/capture}
{Gallery dir='home/imagenes/'.$extra}
Re: attribute within another attribute
Posted: Wed Jun 30, 2010 9:13 am
by Supay
Salketer wrote:
You can use the capture tag to assign the returned values in a variable and then use the variable.
Code: Select all
{capture assign='extra'}{page_attr key="extra1"}{/capture}
{Gallery dir='home/imagenes/'.$extra}
thanks for your answer, but I do not work. I think it is wrong ".$extra" I do not read the gallery. But if I read {$extra}. This good write?
He did not know the attribute capture. I will be useful. Thanks
Re: attribute within another attribute
Posted: Wed Jun 30, 2010 5:30 pm
by Salketer
Sorry I always mix up when working with vars in smarty tags... I tested this time
Code: Select all
{capture assign='extra'}{page_attr key="extra1"}{/capture}
{Gallery dir="home/imagenes/$extra"}
Re: attribute within another attribute
Posted: Thu Jul 01, 2010 7:17 am
by Supay
Salketer wrote:
Sorry I always mix up when working with vars in smarty tags... I tested this time
Code: Select all
{capture assign='extra'}{page_attr key="extra1"}{/capture}
{Gallery dir="home/imagenes/$extra"}
Ou yeah! Thank youuu!!!!!
Re: attribute within another attribute
Posted: Thu Jul 01, 2010 8:17 am
by kermit
it's not in the tag's help, but you can assign the result right to a smarty variable:
{page_attr key='extra1' assign='myvar'}
no need to "capture" it.
Re: attribute within another attribute
Posted: Thu Jul 01, 2010 1:18 pm
by Salketer
Ahh! I did check before using capture... That really should be there
