Changed pages in django cms
For finding of changed pages (or dirty pages) you can use Title model:
dirty_titles = Title.objects.filter(publisher_is_draft=True, publisher_state=PUBLISHER_STATE_DIRTY)
Result can displayed as like:
{% if dirty_titles %}
<p style="font-weight: bold;">Dirty pages:</p>
{% for title in dirty_titles %}
<p class="changelink"><a target="_blank" href="{{ title.page.get_absolute_url }}">{{ title.page.get_title }}</a></p>
{% endfor %}
{% endif %}
If you have multilanguage site, then you need provide group by languages (this property is in instance of Title class). Or you can display your result as like page structure in django cms.
I use my solution for display in information block "Notification" to notify about unpublished changes on pages.
Rate this article
0 from 5 (total 0 ratings)
You can send feedback, suggestions or comments on this article using this form:
After clicking the "Send" button, your message will be delivered to me on the mail.
Artem Maltsev
Web-developer, having the knowlenge of programming language - Python, framework - Django, content management system - Django CMS, platform of e-commerce site - Django Shop and many other applications, using this technologies.
The right to use content on this page https://vivazzi.pro/it/find-dirty-pages/:
Permission is granted to copy an content with its author and reference to the original without using the parameter rel="nofollow"
in tag <a>
. Usage:
Author of Article: Artem Maltsev
Link to article: <a href="https://vivazzi.pro/it/find-dirty-pages/">https://vivazzi.pro/it/find-dirty-pages/</a>
More: Terms of site usage
Comments: 0