vaersaagod / seomate

SEO, mate! It's important. That's why SEOMate provides the tools you need to craft all the meta tags, sitemaps and JSON-LD microdata you need - in one highly configurable, open and friendly package - with a super-light footprint.
MIT License
36 stars 8 forks source link

Solspace Calendar URLs in Sitemap #55

Closed chadcrowell closed 3 years ago

chadcrowell commented 3 years ago

I've got Calendar events showing up in a sitemap, so that is working, with:

'games' => [
                'elementType' => \Solspace\Calendar\Elements\Event::class,
                'criteria' => [
                    'calendar' => 'varsity',
                    'rangeStart' => date('Y').'-01-01',
                    'rangeEnd' => date('Y').'-01-01'
                ],
                'params' => [
                    'changefreq' => 'weekly',
                    'priority' => 0.9
                ]
            ]

The output is:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<!-- Created on: 2021-09-29 11:26:57 -->
<url>
<loc/>
<lastmod>2021-09-18T07:57:26-07:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc/>
<lastmod>2021-09-18T08:08:37-07:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc/>
<lastmod>2021-09-26T10:07:36-07:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.9</priority>
</url>
...
</urlset>

As you can see, the url item is missing. I am unsure how to specify this in seomate.php, or if it should be added automatically? I do have the URI specified with a template in the calendar settings, so I think everything should be in place https://d.pr/i/KEP49F

aelvan commented 3 years ago

Haven't used Solspace Calendar myself, but the only thing SEOMate does is $element->url. So if the element has an URL, it should return it. Could it be something simple like caching that's messing up things? Tried clearing the SEOMate cache?