Closed new-on-github closed 1 month ago
Try $page['meta']['image']
:+1:
Only basic meta data (like titles) can be accessed directly via e.g. $page['title']
. I know, it's confusing...
Thanks a lot, this works now.
But there is now a other problem: It gives not the correct link back. Instead of https://my-domain/path-to-image it gives
%assets_url%/image
back.
Can this also be solved without giving the full correct path in the meta-data-tag?
Ok, thinking before asking would help...
I could achieve this in php with the following code:
$rss .= '<enclosure url="';
$rss .= str_replace('%assets_url%', $this->baseURL."assets", $page['meta']['image']);
$rss .= '"/>';
Thanks a lot for the help and for pico cms!
Instead of https://my-domain/path-to-image it gives
%assets_url%/image
back.
Try $this->getPico()->substituteUrl($page['meta']['image'])
instead (it's the same as Pico's url
Twig filter).
Hello all together,
I'm using pico with the pico-rssmaker: https://github.com/MattByName/Pico-RssMaker https://github.com/MattByName/Pico-RssMaker/blob/master/RssMaker.php it works fine. Now I want to add a image to the other sub items of the rss-feed:
Now some of the meta-data of the yaml-header:
can be accessed via
$page['meta-item-name'];
in php. But this works only with title, description but not with my own meta-tags and also not with the image-tag. I tried this:But this doesn't work.
I already asked the maintainer of Pico-RssMaker. He tried to help, but there is still no solution: https://github.com/MattByName/Pico-RssMaker/issues/6
Does someone know how to access the meta-data-items in php?
Thanks al lot.