mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
ENHANCEMENT Addition of Date, so date can be used in the RSS feed
ENHANCEMENT Allow casting of Date and Title so can be modified in template
This commit is contained in:
parent
01b48e74b7
commit
dcb23d6cc3
@ -51,9 +51,19 @@ class RSSWidget extends Widget {
|
|||||||
$this->feed->init();
|
$this->feed->init();
|
||||||
if($items = $this->feed->get_items(0, $this->NumberToShow)) {
|
if($items = $this->feed->get_items(0, $this->NumberToShow)) {
|
||||||
foreach($items as $item) {
|
foreach($items as $item) {
|
||||||
|
|
||||||
|
// Cast the Date
|
||||||
|
$date = new Date('Date');
|
||||||
|
$date->setValue($item->get_date());
|
||||||
|
|
||||||
|
// Cast the Title
|
||||||
|
$title = new Text('Title');
|
||||||
|
$title->setValue($item->get_title());
|
||||||
|
|
||||||
$output->push(new ArrayData(array(
|
$output->push(new ArrayData(array(
|
||||||
"Title" => $item->get_title(),
|
'Title' => $title,
|
||||||
"Link" => $item->get_link()
|
'Date' => $date,
|
||||||
|
'Link' => $item->get_link()
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
|
Loading…
Reference in New Issue
Block a user