Re: [SMARTY] Template Problem
| From: | messju mohr | Date: | Mon, 12 Jan 2004 16:09:26 +0000 |
| Subject: | Re: [SMARTY] Template Problem | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10812@lists.php.net to get a copy of this message | ||
it's {$bilder.pic[i]} not {$bilder.pic.[$smarty.section.i.index]}
HTH
messju
On Mon, Jan 12, 2004 at 04:56:19PM +0100, Webmaster wrote:
> Why doesn't this work?
>
> The following function is called in my catalog script:
>
> function returnGallery()
> {
> $this->db->select("d_gallerie, d_gallerietxt", "produktkuerzel",
> "(d_produktname = '".$this->productName."')",
> "","","","");
>
> $row = $this->db->fetch_array();
> $bilder['pic'] = explode("**", $row['d_gallerie']);
> $bilder['txt'] = explode("**", $row['d_gallerietxt']);
> if ($bilder['pic'][0] != NULL)
> return $bilder;
> }
>
>
> The relevant part of the template looks like this:
>
> <div id="col3">
> <!-- Gallery: Start-->
> {if $bilder !=""}
> {section name=i loop=$bilder}
> <a
> href="../images/shop/products/{$bilder.pic.[$smarty.section.i.index]}"
> target="_blank">
> <img
> src="../images/shop/products/{$bilder.txt.[$smarty.section.i.index]}"
> alt=""
> /></a><br />
> {/section}
> {/if}
> <!-- Gallery: End-->
> </div>
>
> The error message is:
> Fatal error: Smarty: [in catalog.tpl line 44]: syntax error: unrecognized
> tag: $bilder.pic.[$smarty.section.i.index] (Smarty_Compiler.class.php, line
> 380) in D:\dent\classes\design\libs\Smarty_Compiler.class.php on line 1820
>
> Would anybody know where the problem lies ?
>
> Thank you very much.
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php