|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
machnhed1 Smarty Regular
Joined: 21 Apr 2003 Posts: 39 Location: Illinois
|
Posted: Mon Apr 21, 2003 3:23 pm Post subject: Popup Question |
|
|
I can't put a set of {}s inside another set, so I've been trying different syntax to get this to work.
Below is the code. I bolded the problem in the code.
Code...
{* $Id: product.tpl,v 1.2 2002/04/23 10:38:01 mav Exp $ *}
{section name=field loop=$extra_fields}
{if $extra_fields[field].active eq "Y"}
<tr><td width=30% valign="top">
{$extra_fields[field].field}</td>
<td>
{if %field.index% eq 0}<A href="search.php?substring={$product.param00}" {popup text="See more stuff by $product.param00."}>{$product.param00}</A>{elseif %field.index% eq 1}{$product.param01}{elseif %field.index% eq 2}{$product.param02}{elseif %field.index% eq 3}{$product.param03}{elseif %field.index% eq 4}{$product.param04}{elseif %field.index% eq 5}{$product.param05}{elseif %field.index% eq 6}{$product.param06}{elseif %field.index% eq 7}{$product.param07}{elseif %field.index% eq 8}{$product.param08}{elseif %field.index% eq 9}{$product.param09}{/if}
</td>
</tr>
{/if}
{/section}
That bolded code is suppose to display a name, but it doesn't. The two other instances where I use it work, but this one does not. According to smarty I need to have {} directy around it, but as you can see I can't do that here. So I tried adding backticks around it, but that's no good either. Check out http://smarty.php.net/manual/en/language.syntax.quotes.php to see what I mean.
I'm stumped. Anyone have a suggestion?
Thanks in advance _________________ "Every operating system out there is about equal in the number of vulnerabilities reported. We all suck."
- Microsoft Senior Vice President Brian Valentine |
|
Back to top |
|
machnhed1 Smarty Regular
Joined: 21 Apr 2003 Posts: 39 Location: Illinois
|
Posted: Mon Apr 21, 2003 3:49 pm Post subject: |
|
|
Figured it out...
{assign var="name" value=$product.param00}
then replaced
Code: | {popup text="See more stuff by $product.param00."} |
with
Code: | {popup text="See more stuff by $name."} |
_________________ "Every operating system out there is about equal in the number of vulnerabilities reported. We all suck."
- Microsoft Senior Vice President Brian Valentine |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Apr 21, 2003 8:06 pm Post subject: |
|
|
curious:
does this work?
Code: | {popup text="See more stuff by `$product.param00`."} |
I think that the last '.' may be confusing the parser. The new backtick syntax can do wonders, though |
|
Back to top |
|
machnhed1 Smarty Regular
Joined: 21 Apr 2003 Posts: 39 Location: Illinois
|
Posted: Mon Apr 21, 2003 8:20 pm Post subject: |
|
|
I tried the backticks and they didn't work either. I ended up doing this...
Code: | {assign var="name" value=$product.param00} |
then replaced
Code: | {popup text="See more stuff by $product.param00."} |
with
Code: | {popup text="See more stuff by $name."} |
_________________ "Every operating system out there is about equal in the number of vulnerabilities reported. We all suck."
- Microsoft Senior Vice President Brian Valentine |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|