Marked items from separate sections appearing on index page

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

By kapelle - September 2, 2008

Hi, I just got CMS a few days ago and almost have it ready to go, and I have a question:

I have several section editors, each with their own page:

news
articles on music
articles on websites
articles on songwriting
articles on sound equipment
website links
tutorials
(plus several more)

Each section will have new content every Tuesday.

What I'd like to do is assign every item in every section a date, then be able to put all the items for a specific date on the index page. Is that possible?

So, on the index page will be a "what's new section" and only the items that are tagged with, let's say, "September 2" will show up on the index page. Then, all the new content as well as the old content will all be listed also on the section editor page.

Would I need to put a viewer for each section on the index page? Or would there be a way to group several sections together under a single category, then put a viewer for that category on the index page?

For example, instead of having a separate viewer for each of the article section editors, could I group all the articles under a category, then have a single viewer that would only post articles dated "September 2?"

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