|
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 |
weckie Smarty Rookie
Joined: 11 Sep 2005 Posts: 10
|
Posted: Wed Dec 21, 2005 10:16 pm Post subject: section question. |
|
|
I am using xcart and smarty. In xcart we've a section like this
{section name=product loop=$products}
but i also want in the same section $images.
f.i. {section name=product loop=$products AND $images} <-- but this gives an error.
Does anyone know how to do this?
Thanks. _________________ Regards,
Weckie
www.weckonline.nl
Using Smarty in comb. with X-cart. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Wed Dec 21, 2005 10:22 pm Post subject: |
|
|
stay with {section name=product loop=$products} and just use both, $products[product] and $images[product] inside the section. |
|
Back to top |
|
slyydrr Smarty n00b
Joined: 10 Nov 2008 Posts: 4
|
Posted: Mon Nov 10, 2008 5:02 pm Post subject: |
|
|
Just make sure that your two arrays have a 1:1 correlation though with this (sorted the same way) as you're going to be using the same iterator to go through both arrays. |
|
Back to top |
|
paparts Smarty Rookie
Joined: 09 May 2009 Posts: 8
|
Posted: Sat May 09, 2009 8:58 am Post subject: re |
|
|
yes i agree with slyydrr you can stick with the 1 section or you can add the images on the php file to form an array of data with the image. And simply add Code: | {$products[product].images} | . on the PHP file you can use the its very useful[/code] |
|
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
|