In template: replace placeholder in cms-snippet with variable-value

Hi there,

I’m using a component function to get a url for an article within my tpl.
I also have a cms-snippet defined in which I want to put the url.
Both values are available in the tempalte.

The cms-snippet contains something like

click on this [LINK]

I got my tpl-varaible $sUrl

I like to replace the ‘[LINK]’ of the snippet with the content that’s included in $sUrl.

How can I do that?
:confused:

Thans in advance.

Kind regards
Stefan

try [{$sUrl}]

yeah, this will put the value at the end of the text. After what’s in the cms-snippet.
what if [LINK] is not at the end of the text?

cms-snippet:

if you visit [LINK] you will be redirected....

or do you mean to write in the cms-snippet:

if you visit [{$sUrl}] you will be redirected....

?

yes, i mean using [{$sUrl}] instead of [LINK]

if you visit [{$sUrl}] you will be redirected....

if $sUrl is set in your viewdata, it will be parsed and evaluated

[QUOTE=vanilla thunder;148482]yes, i mean using [{$sUrl}] instead of [LINK]

if you visit [{$sUrl}] you will be redirected....

if $sUrl is set in your viewdata, it will be parsed and evaluated[/QUOTE]

Thank’s a lot, it works ! :smiley: