Add a method to return RSS data for a Story, with tests.
This commit is contained in:
parent
721acb69eb
commit
3853e4dd02
2 changed files with 46 additions and 3 deletions
|
|
@ -454,6 +454,27 @@ sub getPhotoData {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getRssData ( )
|
||||
|
||||
Returns RSS data for this Story. The date of the RSS item is the lastModified
|
||||
property of the Asset.
|
||||
|
||||
=cut
|
||||
|
||||
sub getRssData {
|
||||
my $self = shift;
|
||||
my $data = {
|
||||
title => $self->get('headline') || $self->getTitle,
|
||||
description => $self->get('subtitle'),
|
||||
'link' => $self->getUrl,
|
||||
author => $self->get('byline'),
|
||||
date => $self->get('lastModified'),
|
||||
};
|
||||
return $data;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 prepareView ( $templateId )
|
||||
|
||||
See WebGUI::Asset::prepareView() for details.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue