Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

duplicate pages in the teaser plugin #343

Closed
yml opened this Issue · 3 comments

3 participants

yml Jonas Obrist Patrick Lauber
yml
yml commented

After a fruitful discussion on #django-cms with stefanfoulis and ojii we come to the conclusion that the pages are not exactly duplicated but in fact the pages is shown in its 2 states published and draft.

So this duplication can be solved in at least 2 different ways : by restricting the selection to the published Pages :

------------8<--------------------------------
diff --git a/cms/plugins/teaser/models.py b/cms/plugins/teaser/models.py
index c99150d..6bd7807 100644
--- a/cms/plugins/teaser/models.py
+++ b/cms/plugins/teaser/models.py
@@ -10,7 +10,10 @@ class Teaser(CMSPlugin):
"""
title = models.CharField(("title"), max_length=255)
image = models.ImageField(
("image"), upload_to=CMSPlugin.get_media_path, bla

  • page_link = models.ForeignKey(Page, verbose_name=("page"), help_text=("If p
  • page_link = models.ForeignKey(Page,
  • limit_choices_to={'publisher_is_draft':True}, #Not clear why this need to be true
  • verbose_name=_("page"),
  • help_text=("If present image will be clickable url = models.CharField(("link"), max_length=255, blank=True, null=True, help description = models.TextField(_("description"), blank=True, null=True) ------------8<--------------------------------

or by changing the unicode method to display the state of the Page this will avoid some confusion.

Regards,
--yml

Jonas Obrist
Collaborator

here's the diff a bit more readable: http://gist.github.com/292515

Me and stefan have look at this together with yml yesterday.

yml
yml commented

Ojii,
Your proposal is sligtly different than mine, I am suggesting :

  • limit_choices_to={'publisher_is_draft':True},

I don't know why True is the "good" value because it seems a bit anti natural but I have observed that with False the hyperlink to the page does not get displayed on the published page.
Regards,
--yml

Patrick Lauber
Collaborator

closed by 88701f4, teaser links only draft pages

Christian Bertschy christianbertschy referenced this issue from a commit in christianbertschy/django-cms-2.0
Patrick Lauber digi604 fixes #343, teaser links only draft pages 88701f4
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.