Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picture in News Sitemap #92

Open
Celine35 opened this issue Feb 1, 2018 · 2 comments

Comments

@Celine35
Copy link

commented Feb 1, 2018

Hi,

We generated a txnews sitemap for Google news, but we noticed that pictures of news doesn’t appear in the Google news newsfeed.
I looked into the code of extension dd_googlesitemap and I see media file is not provided in the sitemap structure.

Maybe other users would be interested with this feature.

Thank you in advance for your interest.

Best regards

@stefanvar

This comment has been minimized.

Copy link

commented Feb 2, 2018

Hey,

if you would add these lines to /Classes/Renderers/NewsSitemapRenderer.php News-Extension could submit image data:

line 72:
public function getStartTags() { return '<?xml version="1.0" encoding="UTF-8"?>' . chr(10) . '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" ' . 'xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" ' . 'xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" ' . '>' . chr(10); }

line 91:
public function renderEntry($url, $title, $lastModification = 0, $changeFrequency = '', $keywords = '', $priority = '', $image = '') {

line 105:
$content .= '</news:news>';
// Image
if ($image) {
$content .= 'image:image';
$content .= 'image:loc' . $image . '</image:loc>';
$content .= '</image:image>';
}
$content .= '';

$image should be the absolute image uri (string). Or as an array to submit more than one single image.

Best Regards

@dmitryd

This comment has been minimized.

Copy link
Owner

commented Feb 3, 2019

How would be $image passed to renderEntity?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.