Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

section question.

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Tips and Tricks
View previous topic :: View next topic  
Author Message
weckie
Smarty Rookie


Joined: 11 Sep 2005
Posts: 10

PostPosted: Wed Dec 21, 2005 10:16 pm    Post subject: section question. Reply with quote

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
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Wed Dec 21, 2005 10:22 pm    Post subject: Reply with quote

stay with {section name=product loop=$products} and just use both, $products[product] and $images[product] inside the section.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
slyydrr
Smarty n00b


Joined: 10 Nov 2008
Posts: 4

PostPosted: Mon Nov 10, 2008 5:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
paparts
Smarty Rookie


Joined: 09 May 2009
Posts: 8

PostPosted: Sat May 09, 2009 8:58 am    Post subject: re Reply with quote

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
Code:
array_push();
its very useful[/code]
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Tips and Tricks All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP