Open new-on-github opened 5 months ago
hi thanks for raising an issue. I can take a look this weekend.
Thanks a lot for your very quick reply. This would be amazing!
I also tried:
$rss .= '<enclosure>';
$rss .= $meta['image'];
$rss .= '</enclosure>';
without success.
Unfortunately, I've had trouble getting Pico to run at all- I don't actually use it anymore. I think what you'd need is to make sure image is a url to the image, and then add either:
$rss .= '<enclosure url="';
$rss .= $meta['image'];
$rss .= '"/>';
or
$rss .= '<enclosure url="';
$rss .= $page.meta['image'];
$rss .= '"/>';
or
$rss .= '<enclosure url="';
$rss .= $page['image'];
$rss .= '"/>';
If you can get it to work, do let me know and I can update the plugin :)
I tried it all. But the rss-file gives always a empty enclosure-item back.
<enclosure url=""/>
I think the problem is, that $page['image'];
does not reference to the meta header item image: %assets_url%/...
. To get the time with pico-rssmaker you also not call $page['date'];
but $page['time'];
. Maybe there is a function which gets the meta-data and puts it somewhere else...
Perhaps image is a keyword? Could you try renaming it to rssimage?
Thanks for this idea. But this seems not to be the problem. I will have to think about it or ask somewhere else. Thanks a lot for your help to this point!
With some help from the pros https://github.com/picocms/Pico/issues/698 it works now with the following code:
$rss .= '<enclosure url="';
$rss .= str_replace('%assets_url%', $this->baseURL."assets", $page['meta']['image']);
$rss .= '"/>';
Thanks for your help!
I use Pico-RssMaker and like it.
it seems possible to add a image to a rss-item as sub-element: https://www.rssboard.org/rss-specification#ltenclosuregtSubelementOfLtitemgt I want to add a image form the meta-tag "image" from my pico-md-yaml-header.
How to do this in php. I tried some versions like:
$rss .= '<enclosure>'; $rss .= $page['image']; $rss .= '</enclosure>';
But this is not working.
My question now is: How to access the page-meta-data via php?
It would be really nice if you could help me with this question.
Btw thanks a lot for the Pico-RssMaker!