Page list using custom page's attributes?

Permalink
Hey.

I'm looking for simple solution of my problem.
Every page on my site is description of some training.
Every training has some date planned (let's say - 3 dates in the future.)

I wanted to add custom "date" attribute to these pages (like: term1, term2, term3) and add block on main page, to display next, nearest trainings available.

Could anybody give me some tip how to code it using c5 engine ?

It's like a page list, but display criteria should be value of "term" attribute. Or something like that.
No calendars or other sophisticated solutions. Just custom attribute...

jagd
 
ScottSandbakken replied on at Permalink Reply
ScottSandbakken
If I had to do this and I was the only one managing the site, I would setup a text attribute like this: yyyymmdd:term1Name,yyyymmdd:term2Name,yyyymmdd:term3Name.

I would then pull the attribute in my page list, and use split(',',attrib) to create an array of dates&Names, then use split(':',dates&Names) to separate the names and dates.

Order it all by date, then find the next date(s) and display it/them.

Of course, this is a hack job and certainly not something I would allow a normal user to administer as the format is too important, but it would get the job done.

Your other option is to setup multiple attributes to hold both the date information and the term name and add some error handling for when the two attributes do not line up.