Custom Attributes on Page list Template

Permalink
Hi, novice question here. I hav e created custom attributes for my events pages and these are Start Date, End Date and Venue. I would like these to be displayed on my pagelist template.

I tried using <?php echo $c->getCollectionAttributeValue('date_start') ?> but I get errors.

Thanks in advance

chansolo
 
dancer replied on at Permalink Best Answer Reply
dancer
I am no PHP person.. infact far from it but have you tried:
$cobj->getAttribute('date_start');
chansolo replied on at Permalink Reply
chansolo
Thanks man I finally managed to to set it up. The next issue now is How do I format the date. Currently it displays it as "2011-03-31 00:00:00" and I would like to display it as "31 March 2011" without the time.
dancer replied on at Permalink Reply
dancer
You need to load in the helper

$date = Loader::helper("date");
[]/code
And then
[code]
$dateTime = $cobj->getCollectionDatePublic('jS F, Y');


Check PHP manual for different
http://php.net/manual/en/function.date.php...


Gd Lk
chansolo replied on at Permalink Reply
chansolo
Thanks for the response, I used

$starting = strtotime($cobj->getAttribute('date_start'));
$startDate = date('F j, Y',$starting);
$ending = strtotime($cobj->getAttribute('date_end'));
$endDate = date('F j, Y',$ending);


fromhttp://www.concrete5.org/index.php?cID=41854...