Page 1 of 1

Recursion with smarty templates

Posted: Mon Nov 26, 2007 9:40 pm
by Lahuindai
Some specifics first:
OS: Linux (kernel v2.6.14)
Distro: Ubuntu 7.10
php: v5
cmsms: v1.2.1

Now the question in 2 parts:
1. I know quite a while ago smarty was going to implement functions to deal with recursion better, the question is what version of smarty is integrated now and do we know if this has the recursion tags in yet ?
2. What would be the best way to similate the Content->Pages list in a module.

Reason i'm asking is that i'm finishing off ShopMadeSimple (yes i can hear it ... "Finally" right) module and do not want to stray from the admin functionality. If anybody can point me in the right direction on either of the 2 it would speed things up.

Also just to put everybody at ease, i have a paying client for ShopMadeSimple which moves it up (quite a bit) in my priority list. First code is already in the SVN, this is pre alpha and have only install/uninstall and some basics in.

Features will be as follows:
- Users are managed in FrontEndUsers
  - Install Creates ShpMadeSimple user group with some basic fields. (Done)
- Categories (Partial, waiting on questions above)
- Products can belong to many categories. (Done - api)
- Product types to allow for expansion of products. (Done - api)
- Type options can influence price. (Done - api)
- Add to cart is an event, shop does not deal with cart (CartMadeSimple is coming)
- Discounts on Category, Product Type or Product for a duration (Partial)

Calguy i believe you are working on something similar, maybe we can share code/ideas ?

Re: Recursion with smarty templates

Posted: Tue Nov 27, 2007 1:06 am
by calguy1000
Well, we're using Smarty 2.6.18 in CMS now..... so I'm not sure what kind of recursion you want, but smarty is pretty recent.

and I don't know what you mean by #2 :)

Re: Recursion with smarty templates

Posted: Tue Nov 27, 2007 1:17 am
by Lahuindai
What i mean by #2 is:

When you navigate to the content section and then to pages, you get a very nice list/structure of the site. ie

page
- Sub page
- Sub page
page

etc.
These can be expanded/collapsed and selected to edit and does this in a nice ajaxy way. I would like to do the same for Categories in my module ...

Re: Recursion with smarty templates

Posted: Tue Nov 27, 2007 1:59 am
by calguy1000
well, then I'd look at a nice and simple ajaxy tree class.  that'd be the simplest way.