attribute within another attribute

General project discussion. NOT for help questions.
Post Reply
Supay
Forum Members
Forum Members
Posts: 11
Joined: Mon Jun 28, 2010 9:16 am

attribute within another attribute

Post by Supay »

First: Sorry for my english :D
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!!!
Salketer

Re: attribute within another attribute

Post 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}
Supay
Forum Members
Forum Members
Posts: 11
Joined: Mon Jun 28, 2010 9:16 am

Re: attribute within another attribute

Post 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
Salketer

Re: attribute within another attribute

Post 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"}
Supay
Forum Members
Forum Members
Posts: 11
Joined: Mon Jun 28, 2010 9:16 am

Re: attribute within another attribute

Post 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!!!!!
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Re: attribute within another attribute

Post 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.
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
Salketer

Re: attribute within another attribute

Post by Salketer »

Ahh! I did check before using capture... That really should be there :)
Post Reply

Return to “General Discussion”