Display date in Page List block

Permalink
We have a news section set up on one of our sites. The stories are a page type in Composer. The user can set a headline, description, published date, and the main story. We used this guide to create the functionality:
http://www.concrete5.org/documentation/how-tos/developers/create-a-...

We are using the Page List block to list stories under a News section and in a sidebar on the home page. Similar to how a blog would work.

We'd like the format of these lists to be:
Story Headline
date published

Currently, to do that, we are putting the date in the story's description. We'd like C5 to pull the date published from the story's date that was input when the story was created.

The code we're using to get the description is this:
<?php  
  $newsDescription = $cobj->getAttribute('news_description');
  if (!empty($newsDescription)) {
    echo $newsDescription;
  }
?>


Since the date is not an Attribute we added, I'm not sure how to get the date from the story. Any ideas?

CygnetMidwest
 
juddc replied on at Permalink Reply
juddc
5.7's page list block comes with "Include Public Page Date".

If 5.6, you can use the date helper (refer to view.php in the core page list block folder) in your page list template and then add something like
<?php echo $date ?>
hutman replied on at Permalink Reply
hutman
If you're using 5.6 and the Public Date on the Page you can do something like this

echo $cobj->getCollectionDatePublic('m/d/Y');