Re: [SMARTY] How can I assign a template to the popup text?

From: Date: Fri, 21 Jan 2005 16:20:27 +0000
Subject: Re: [SMARTY] How can I assign a template to the popup text?
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-12186@lists.php.net to get a copy of this message
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

« previous php.smarty.general (#12186) next »