Product of the Month box.

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

Re: [steve_e] Product of the Month box.

By Dave - June 26, 2008

Hi Steve,

There's a few features you can put together to make this work.

You can automatically have records show and be hidden with the special fields 'publishDate' and 'removeDate'. Create date fields for those. You can read more about special fields here: http://www.interactivetools.com/docs/cmsbuilder/special_fieldnames.html

Once that's done, your list should only show records within the date range, but you only want to show one, so add this to your viewer code (in red):

list($yourRecords, $yourDetails) = getRecords(array(
'tableName' => 'yourTable',
'limit' => '1',
));


And that will only show the first result. So in the event that you do have more than one product setup for a date range it will just show one.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com