Re: [SMARTY] How can I assign a template to the popup text?
| From: | pt2002 | Date: | Fri, 21 Jan 2005 17:57:50 +0000 |
| Subject: | Re: [SMARTY] How can I assign a template to the popup text? | ||
| References: | 1 2 3 4 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12190@lists.php.net to get a copy of this message | ||
Hi
Yes. That's the way I get it to work after your first reply {include
file="pop.tpl" assign="popuptext"}
Thank you.
Greetings
"Monte Ohrt" <monte@newdigitalgroup.com> escreveu na mensagem
news:41F13AF7.9020700@newdigitalgroup.com...
> include does support assign:
>
> {include file="..." assign="foo"}
>
> pt2002 wrote:
>
>>Hi
>>Thank you very much.
>>I was looking for a better solution. Using {include file....} it's a bit
>>slower than using
>>{assign var=popuptext value='<table>....'} but that's not a big
>>problem.
>>
>>Greetings
>>
>>"Messju Mohr" <messju@lammfellpuschen.de> escreveu na mensagem
>>news:20050121162027.GC2324@pharao.serveftp.org...
>>
>>>On Fri, Jan 21, 2005 at 04:05:40PM -0000, pt2002 wrote:
>>>
>>>>Hello
>>>>I have a small template that I need to use in the popup text inside a
>>>>section. In the php script I fetch the template and assign it to a var
>>>>but
>>>>it doesn't work. I see the popup but without any content. Just the
>>>>static
>>>>Email: and City but not the data.
>>>>
>>>>$tpl->assign('popuptext', $tpl->fetch('pop.tpl'));
>>>>
>>>at this point of time $data[list] has no value, and that's the reason
>>>why your popup has no values.
>>>
>>>
>>>>The fetched template depends on a condition. It can be pop.tpl,
>>>>pop1.tpl,
>>>>pop2.tpl or pop3.tpl.
>>>>
>>>>pop.tpl:
>>>><table style='font-size: 12px'>
>>>><tr>
>>>><td
>>>>align='right'><b>Email:</b></td><td>{$data[list].email}/td>
>>>></tr>
>>>><tr>
>>>><td align='right'><b>City:</b></td>
>>>><td>{$data[list].city}</td>
>>>></tr>
>>>></table>
>>>>
>>>>The template with the popups:
>>>><table border="0" cellspacing="3"
>>>>cellpadding="2">
>>>>
>>>>{section name=list loop=$data}
>>>>
>>>maybe use {capture} and {include} here to assign $popuptext.
>>>
>>>
>>>><tr>
>>>><td>
>>>><a href="javascript:void(0);" {popup
>>>>text=$popuptext}>{$data[list].idusers}</a>
>>>></td>
>>>><td>
>>>><a href="javascript:void(0);" {popup
>>>>text=$popuptext}>{$data[list].name}</a>
>>>></td>
>>>></tr>
>>>>{/section}
>>>></table>
>>>>
>>>>Need some help with this.
>>>>Greetings
>>
>>