different every day

3 posts by 2 authors in: Forums > CMS Builder
Last Post: January 12, 2011   (RSS)

Re: [jtedescojam] different every day

By Jason - January 12, 2011

Hi,

There are a number of different ways to do this depending on the exact functionality you need.

One approach is to use the removeDate special field. What you do is go into your section editor for italian_word_of_the_day and add a date/time field and give it the name removeDate (NOTE the name must be exactly like that).

For each record, give the record a removeDate of the day AFTER you want it to appear.

So if you want the record to appear January 12, give it a remove date of January 13.

You would then select the record like this:

list($italian_word_of_the_dayRecords, $italian_word_of_the_dayMetaData) = getRecords(array(
'tableName' => 'italian_word_of_the_day',
'where' => whereRecordNumberInUrl(1),
'orderBy' => 'removeDate ASC',
'limit' => '1'
));


If you ever want a record to appear again, you can just go in and adjust it's removeDate. The one issue with this is that you do need to manage your records. If there is no record with a removeDate that's after the current date, no record will be selected.

Give this a try.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] different every day

Thanks Jason.. this is good enough
John Tedesco

Creative Director



JAM Graphics