Closed niz11 closed 4 years ago
djangocms-page-sitemap only handles django CMS pages.
By replacing def items(self):
with the one from ExtendedSitemap
you will get a list of cms pages in your sitemap.
There is not much code you can reuse, if you have to implement what this application does for cms pages in custom applications.
best pointer I can give you is to include the fields directly in your models (like Post.changefreq
etc), adapt your PostSitemap(Sitemap)
copy the logic from ExtendedSitemap
and implement a toolbar similar to PageSitemapPropertiesMeta
(but likely simpler due to the permissions and state check logic in PageSitemapPropertiesMeta
)
Thank you for the quick response and happy new year :)
Happy for being helpful happy new year you too!
Hi there,
So I start working in a company that uses Django cms. They have three different sitemaps. One using your extensions, and the other two using the Django sitemap. Your extension provides the nice menu tool, so I was trying to convert the other two sitemaps to use your extension. When I'm trying to change one of the Django sitemaps to use the extension, I'm getting two identical sitemaps. The sitemap that originally used the extension. Any idea why? In urls I didn't change anything. And inside the sitemap, I converted it from:
from .models import Post from django.contrib.sitemaps import Sitemap
class PostSitemap(Sitemap): changefreq = "weekly" protocol = "https"
to: from djangocms_page_sitemap.sitemap import ExtendedSitemap
class PostSitemap(ExtendedSitemap): protocol = "https"
Any suggestions?