Home > Archive > PHP Smarty Templates > November 2004 > Re: [SMARTY] popup
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: [SMARTY] popup
|
|
| Messju Mohr 2004-11-19, 8:59 am |
| On Fri, Nov 19, 2004 at 08:21:51AM +0100, Bertrand Zuchuat wrote:
> Hello,
>
> I have a problem with popup function.
>
> I load my values into the array $content.
>
> Il will like to put values into the popup.
>
> How to make this information into the popup.
>
>
> With this syntax, i have an error:
> {popup caption={$smarty.const.LIBRARY} fgcolor="#e2eeff"
> bgcolor="#D8EEFF" capcolor="#000677" text={$content.library_name}}
you cannot nest smarty tags. use:
{popup caption=$smarty.const.LIBRARY fgcolor="#e2eeff"
bgcolor="#D8EEFF" capcolor="#000677" text=$content.library_name}
> Please help me
>
>
> Thank's
>
> Bertrand
>
> PS: Sorry for my bad english.
| |
| Bertrand Zuchuat 2004-11-19, 8:57 pm |
|
Le 19 nov. 04, =E0 10:20, messju mohr a =E9crit :
> {popup caption=3D$smarty.const.LIBRARY fgcolor=3D"#e2eeff"
> bgcolor=3D"#D8EEFF" capcolor=3D"#000677" text=3D$content.library_name}
I tested this. I have a strange result
In my popup, i have this result
Library (This translate is ok)
Array.library_name (This translate is bad)
Where is my problem ?
Thank's
Bertrand=
| |
| Jochem Maas 2004-11-19, 8:57 pm |
| Bertrand Zuchuat wrote:
>
> Le 19 nov. 04, à 10:20, messju mohr a écrit :
>
>
>
> I tested this. I have a strange result
>
> In my popup, i have this result
>
> Library (This translate is ok)
> Array.library_name (This translate is bad)
>
> Where is my problem ?
very difficult to say because you are not specific enough about your
problem.
firstly you should include the actual error message - this helps people
to understand your problem.
secondly, $content.library_name would equal 'TESTING 123' assuming $tpl
was your smarty object.
$arr = array('library_name' = 'TESTING 123');
$tpl->assign('content', $arr);
so the question is: is 'content' assigned to an assoc. array in
your php script? (try using print_r() on the var you are assigning
to the template, also check you are not overriding the variable later
on, but before output)
http://smarty.php.net/docs.php [choose your lang]
thirdly have you read the manual? if not please do. I'm sure questions
regarding the meaning of specific manual entries will be welcomed
(somebody[ies] took alot of time to write them, and knowing people
actual bother to read them is nice.) if you dont understand stuff in there.
http://smarty.php.net/manual/en/lan...igned.variables
fourthly smarty has a rather fancy debug console which tells you
everything about your tpl contents etc etc. its very easy to setup.
the value of your 'content' var will also be shown ;-)
rgds,
Jochem
>
> Thank's
>
> Bertrand
| |
|
| --- Bertrand Zuchuat <bertrand.zuchuat@rero.ch> wrote:
> Le 19 nov. 04, à 10:20, messju mohr a écrit :
>
>
> I tested this. I have a strange result
>
> In my popup, i have this result
>
> Library (This translate is ok)
> Array.library_name (This translate is bad)
>
> Where is my problem ?
Assuming $content is being sent as an array from your PHP code, it
looks like your code isn't exactly what you posted but rather:
{popup caption=$smarty.const.LIBRARY fgcolor="#e2eeff"
bgcolor="#D8EEFF" capcolor="#000677" text="$content.library_name"}
Where there are quotes around the text attribute value. If it is
written as you posted, it looks like it should work.
xo boots
| |
| Bertrand Zuchuat 2004-11-22, 9:03 am |
|
On 19 nov. 04, at 23:40, boots wrote:
> Assuming $content is being sent as an array from your PHP code, it
> looks like your code isn't exactly what you posted but rather:
>
> {popup caption=$smarty.const.LIBRARY fgcolor="#e2eeff"
> bgcolor="#D8EEFF" capcolor="#000677" text="$content.library_name"}
>
> Where there are quotes around the text attribute value. If it is
> written as you posted, it looks like it should work.
Hello,
I use this code into my page:
<td valign="top">
{foreach name=local key=key item=item from=$value.localisation}
<acronym {popup caption=$smarty.const.LIBRARY|ucfirst fgcolor="#e2eeff"
bgcolor="#D8EEFF"
capcolor="#000677" text="
$item.library_name ($key)<br>
$item.library_street<br>
$item.postal_code $item.city<br>
$item.phone"}>{$key}</acronym><br>
{/foreach}
</td>
Outside the popup function, the value $item.library_name is OK.
Inside the foreach, the value is Array.library_name (isn't OK).
Thank's for your help.
Bertrand
| |
| Jochem Maas 2004-11-22, 9:03 am |
| Bertrand Zuchuat wrote:
>
> On 19 nov. 04, at 23:40, boots wrote:
>
>
>
> Hello,
>
> I use this code into my page:
> <td valign="top">
> {foreach name=local key=key item=item from=$value.localisation}
> <acronym {popup caption=$smarty.const.LIBRARY|ucfirst fgcolor="#e2eeff"
> bgcolor="#D8EEFF"
> capcolor="#000677" text="
> $item.library_name ($key)<br>
> $item.library_street<br>
> $item.postal_code $item.city<br>
> $item.phone"}>{$key}</acronym><br>
> {/foreach}
> </td>
try:
{foreach name=local key=key item=item from=$value.localisation}
<acronym {popup caption=$smarty.const.LIBRARY|ucfirst fgcolor="#e2eeff"
bgcolor="#D8EEFF"
capcolor="#000677" text="
`$item.library_name` ($key)<br>
`$item.library_street`<br>
`$item.postal_code` `$item.city`<br>
`$item.phone`"}>{$key}</acronym><br>
{/foreach}
> Outside the popup function, the value $item.library_name is OK.
> Inside the foreach, the value is Array.library_name (isn't OK).
>
>
> Thank's for your help.
>
> Bertrand
>
| |
| Bertrand Zuchuat 2004-11-22, 9:03 am |
|
On 22 nov. 04, at 10:40, Jochem Maas wrote:
> {foreach name=local key=key item=item from=$value.localisation}
> <acronym {popup caption=$smarty.const.LIBRARY|ucfirst fgcolor="#e2eeff"
> bgcolor="#D8EEFF"
> capcolor="#000677" text="
> `$item.library_name` ($key)<br>
> `$item.library_street`<br>
> `$item.postal_code` `$item.city`<br>
> `$item.phone`"}>{$key}</acronym><br>
> {/foreach}
It's OK.
Very Good.
Thank's
Bertrand
|
|
|
|
|