how to put g2 url into a variable with smarty?

mexicoshaun

Joined: 2007-06-21
Posts: 15
Posted: Thu, 2012-07-19 12:46

I want to take my photo url and replace some characters, hoping to do it with smarty replace, problem is i can't work out how to put the url into a variable

the code to make the url is:

Quote:
{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.thumb.id`"}

i want to put it into a variable called name , tried this

Quote:
{assign var='name' value='g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.thumb.id`"'}

but it doesnt work, the output is g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.thumb.id`" when i want it to be something like thisfolder/thisimage.jpg

any help appreciated , i think it should be simple but im flumoxed..

[i should point out this is related to my other current thread below called URL Rewrite Plugin - how to stop [or swap] "+" being inserted into photo names where a space exists? - but i figured this was a slightly different question and could be a useful answer for others on unrelated tasks]

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2012-07-19 13:06

*EDIT

{capture assign="name"}{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.thumb.id`"}{/capture}

-s

 
mexicoshaun

Joined: 2007-06-21
Posts: 15
Posted: Thu, 2012-07-19 13:50

thanks so much, that's perfect