By Guest on Monday, 12 June 2023
Replies 7
Likes 0
Views 604
Votes 0
Since upgrading to jEvents 3.6.55 the RSS feed provided my the Latest Events module (modlatest) seem to have changed. We previously customized the feed to include custom fields, but when adding it to rss.php they do not appear. We previously added the below code to the requiered fields:

$item->startDate = $item_startdate;
$item->endDate = $item_enddate;
$item->identifier = $row->get('extra_info');
$item->season = $row->customfields['season']['value'];
$item->state = $row->customfields['Status']['value'];
$country_3lc = str_replace('/','',$row->get('loc_country'));
$item->countryName = $country_3lc;
$item->countryCode = $country_3lc;
$item->countryFlag = JUri::base().'images/jevents/jevlocations/thumbnails/thumb_'.$row->get('loc_image');
$item->logo = $row->_imageurl1? (JUri::base().$row->_imageurl1) : '';
$item->picture = $row->_imageurl2? (JUri::base().$row->_imageurl2) : '';
$item->id = $item_slug;
$item->city = $row->get('loc_city');
$item->city = $row->get('loc_city');
$item->standardimage2 = $row->_imageurl2? (JUri::base().$row->_imageurl2) : '';;
$item->shortname = $row->get('extra_info');
$item->type = $row->customfields['type']['value'];
$item->subtype = $row->customfields['subtype']['value'];

Should customfields be called a different way ?
You still have the custom fields plugin configured to output in 'list' views?
·
Tuesday, 13 June 2023 11:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Geraint, yes the plugin is set to display the output in list. I also played around with rss.php and adding:

$item->comments ="";
foreach( $row->customfields as $key => $custom) {
$item->comments .= "<$key>".$row->customfields[$key]['value']."</$key>";
#$item->comments .= "<$key>".$key."</$key>\n";
}
$item->comments .="\n";

Gives me a list of all custom fields within <comments></comments> however when I try to make it independent for a single field, neither:

$item->season = $row->customfields['season']['value'];

or:

$item->season = $row->customfields['season']['value'];
foreach( $row->customfields['season']['value'] as $key => $custom) {
$item->season .= "<season>".$row->customfields['season']['value']."</season>";
}

gives us an output.
·
Monday, 26 June 2023 10:16
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes it is. Have you received my two last messages ?
·
Wednesday, 28 June 2023 08:31
·
0 Likes
·
0 Votes
·
0 Comments
·
I have used the proposed default code which gives me a list of all custom fields within the comments tag:


$item->comments ="";
foreach( $row->customfields as $key => $custom) {
$item->comments .= "<$key>".$row->customfields[$key]['value']."</$key>";
#$item->comments .= "<$key>".$key."</$key>\n";
}
$item->comments .="\n";


But when I try with a single custom field I get nothing:


$item->season = $row->customfields['season']['value'];
foreach( $row->customfields['season']['value'] as $key => $custom) {
$item->season .= "<season>".$row->customfields['season']['value']."</season>";
}


Any tips ?
·
Wednesday, 28 June 2023 08:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Take a look at the Joomla RssRenderer.php file at libraries/src/Document/Renderer/Feed/RssRenderer.php

comments are supported but not other output fields
·
Thursday, 29 June 2023 13:00
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Geraint, this was the file I forgot about. I have been able to update it and now my RSS feed is working in the desired format. Thank you !
·
Monday, 03 July 2023 09:06
·
0 Likes
·
0 Votes
·
0 Comments
·
If you change this file anything you add will be lost when you upgrade Joomla.

If you have a use case for extending the functionality you could create Pull Request at Joomla - https://github.com/joomla/joomla-cms/blob/4.3-dev/libraries/src/Document/Renderer/Feed/RssRenderer.php
·
Wednesday, 05 July 2023 11:34
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post