|
Posted by Pedro on 09/29/66 11:31
I would use {capture}
eg
{capture assign=foo}
<strong>{$bin.item_name|escape:'quotes'}</strong><br/>{$bin.item_category|escape:'quotes'}
{/capture}
then later in the template
{popup text=$foo}
have fun
Pete
A.J. Brown wrote:
> Hi All,
>
> Is there any way to use modifiers on embedded variables using backticks?
> For example, I need to escape quotes for the "text" parameter of a {popup}
> tag. There is static text combined with smarty variables inside the text
> parameter,
>
> {popup text="<strong>`$bin.item_name`</strong><br/>`$bin.item_category`"
> textsize="2" width="400"}
>
>
> What I want is something like this:
>
> {popup
> text="<strong>`$bin.item_name|escape:"quotes"`</strong><br/>`$bin.item_categ
> ory|escape:"quotes"`"}
>
>
> I've had to resort to the following:
>
>
> {assign var="popdesc"
> value="<strong>`$bin.item_name`</strong><br/>`$bin.item_category`"}
>
> {popup text=$popdesc|escape:"string"}
>
>
>
> This works fine for this application. However, I've run across similar
> situations where using {assign} was not appropriate, and I've had to resort
> to formatting the string in the business logic :(. Is there any way to use
> modifiers on `backticked` variables that I'm missing?
>
>
> Thanks!
>
> A.J. Brown,
> BitNotion Intellect
Navigation:
[Reply to this message]
|