Re: $smarty variable in a plugin/template
| From: | Andr� Rabold | Date: | Fri, 11 Oct 2002 06:54:19 +0000 |
| Subject: | Re: $smarty variable in a plugin/template | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6114@lists.php.net to get a copy of this message | ||
Perhaps this is a workaround for you but I havent tested it yet:
{assign var="_man" value=$smarty.get.man}
{moddropper modname='topx.php'
xtra='table=products:isow=manufacturers_id:isoid=$_man:num=15:look=products_
date_added:way=ASC'}
It seems like smarty neither likes string concatening nor using $x.y.z vars
within a string. In my projects I therefor your the above workaround. The
trick is that you use a simple var ($_man) instead of a multidimensional one
($smarty.get.man) to make it work.
Have fun,
André
"Guido" <sguido@rogers.com> schrieb im Newsbeitrag
news:4441304462.20021010005413@rogers.com...
> I'm new at smarty and I've search for this answer but I can't see to
> get this to work..
>
> I have a variable coming via url that is: man=2
>
> I've created a plugin module that I use to drop modules on a page and
> I call it from the template page like this:
>
> {moddropper modname='topx.php'
>
xtra='table=products:isow=manufacturers_id:isoid=1:num=15:look=products_date
_added:way=ASC'}
>
> this works correctly in showing the data..
>
> Now the problem occurs when I want to make the isoid=1 value dynamic
> and use the "man" value from the url .. I can use: {$smarty.get.man}
> anywhere on the page and it shows correctly as 2.. But I can't seem to
> get it to show 2 in the above system..
>
> I've tried:
> {moddropper modname='topx.php'
>
xtra='table=products:isow=manufacturers_id:isoid={$smarty.get.man}:num=15:lo
ok=products_date_added:way=ASC'}
>
> and
>
> {moddropper modname='topx.php'
>
xtra='table=products:isow=manufacturers_id:isoid=$smarty.get.man:num=15:look
=products_date_added:way=ASC'}
>
> and
>
> {moddropper modname='topx.php'
>
xtra='table=products:isow=manufacturers_id:isoid=#$smarty.get.man#:num=15:lo
ok=products_date_added:way=ASC'}
>
>
> and nothing has worked ... is it possible to call the $smarty value in the
> plugin call, or am I missing something easy?
>
> --
> Best regards,
> guido mailto:sguido@rogers.com
>