Marked items from separate sections appearing on index page

2 posts by 2 authors in: Forums > CMS Builder
Last Post: September 2, 2008   (RSS)

Re: [kapelle] Marked items from separate sections appearing on index page

By Dave - September 2, 2008

Hi kapelle, welcome to the CMS Builder forum! :)

Yes, you could group all your articles under one section and add a pulldown field for "category". Then you could list articles from a specific category by adding this to your viewer code:

'where' => " category = 'music' ",

Showing articles from September 2 is a little more tricky, but possible with mysql. Here's some code, I'll assume your date field is called "articleDate" (just change that name to whatever it's really called):

'where' => " DATE_FORMAT(articleDate, '%M %e') = 'September 2' ",

And then if you wanted to combine them you'd have:

'where' => " category = 'music' AND DATE_FORMAT(articleDate, '%M %e') = 'September 2' ",

Hope that makes sense! Give it a try and let me know if you run into any more problems or challenges with it.
Dave Edis - Senior Developer
interactivetools.com