User tests: Successful: Unsuccessful:
In feeds from WordPress blogs, the Dublin Core creator tag is used instead of the author tag. This PR uses the Dublin Core creator tag as a fallback when the author tag is not present in a feed item.
To test, put something like the following code into a template override for the mod_feed module and point the module at a WordPress feed.
foreach ($feed as $item)
{
echo $item->author->name;
}
You should get a string comprising all the authors of the blog posts in the feed. You might need to check the raw feed data to see what is actually being sent by WordPress.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
@chrisdavenport sorry for being thick - where in the module should I put that snippet. Tried a few places but no joy in displaying the author and we dont have anywhere in core (that I can find) that does
Either modules/mod_feed/tmpl/default.php
Or copy that file to templates/[template]/html/mod_feed/default.php and put it there.
Yes I know the file - but where in the file - wherever I have tried
produced no output
On 19 February 2016 at 11:59, Chris Davenport notifications@github.com
wrote:
Either modules/mod_feed/tmpl/default.php
Or copy that file to templates/[template]/html/mod_feed/default.php and
put it there.—
Reply to this email directly or view it on GitHub
#9152 (comment).
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
Shouldn't make much difference where you put it. Try removing everything from the file and just have the snippet. Does that show anything?
Also, try this blog: http://blogs.ncvo.org.uk/feed
I replaced the entire module code with
defined('_JEXEC') or die;
foreach ($feed as $item)
{
echo $item->author->name;
}
echo "brian";
?>
and all that was output in the module was brian
`
Hmmm, okay, it looks like you can't foreach over the feed entries any more. That might be another bug.
Anyway, try this code in your override:
<?php
for ($i = 0; $i < $params->get('rssitems', 5); $i++)
{
if (!$feed->offsetExists($i))
{
break;
}
echo $feed[$i]->author->name;
}
echo "brian";
You should get twodropletsblogbrian
No that doesnt work either - sorry not wasting my time on this any more - i
will leave it to others
On 19 February 2016 at 17:00, Chris Davenport notifications@github.com
wrote:
Hmmm, okay, it looks like you can't foreach over the feed entries any
more. That might be another bug.Anyway, try this code in your override:
<?phpfor ($i = 0; $i < $params->get('rssitems', 5); $i++){ if (!$feed->offsetExists($i)) { break; } echo $feed[$i]->author->name;}echo "brian";
You should get twodropletsblogbrian
—
Reply to this email directly or view it on GitHub
#9152 (comment).
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
Status | Pending | ⇒ | Information Required |
Category | ⇒ | Libraries |
I'm closing this for now as further work has revealed that the rabbit hole goes much deeper than I thought and this is not the correct way to fix the problem anyway. I'll submit another PR when I have a more complete solution. Thanks for trying to test. :-)
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-03-31 18:26:07 |
Closed_By | ⇒ | chrisdavenport |
For testing you can use the feed from https://twodropletsblog.wordpress.com/ which uses dc:creator instead of author
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9152.