[Answered ]-Django-cms absolute urls to pages

2👍

I can offer you no better solution than to wait for the 2.4 release which will use Django’s built-in i18n_urlpatterns to handle this, which should fix the issue you have, for now, your answer is the only way to go.

👤ojii

0👍

I bet there is a better way to do it but now I loop through titles on the page object.

for title in page.title_set.all():
    print title.language, title.slug

It works, but I do not like it…

0👍

Maybe you could use the sitemap strategy. django cms has it’s own sitemap class that runs this code:

class CMSSitemap(Sitemap):
    changefreq = "monthly"
    priority = 0.5

    def items(self):
        all_titles = Title.objects.public().filter(
            Q(redirect='') | Q(redirect__isnull=True),
            page__login_required=False,
            page__site=Site.objects.get_current(),
        ).order_by('page__path')
        return all_titles

Leave a comment