From 5fc9854d36fc8d7dfdd49b4abd941b627700cda9 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Thu, 16 Jun 2011 09:40:18 +0000 Subject: [PATCH] Rough outline of pad+dexterity howto added. svn path=/plone.app.discussion/trunk/; revision=50483 --- ...pad_work_with_a_dexterity_content_type.txt | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 docs/source/howtos/howto_make_pad_work_with_a_dexterity_content_type.txt diff --git a/docs/source/howtos/howto_make_pad_work_with_a_dexterity_content_type.txt b/docs/source/howtos/howto_make_pad_work_with_a_dexterity_content_type.txt new file mode 100644 index 0000000..fd17fd0 --- /dev/null +++ b/docs/source/howtos/howto_make_pad_work_with_a_dexterity_content_type.txt @@ -0,0 +1,30 @@ +configure.zcml:: + + + +Define an interface IMyDexterityContentType groked schema, I added: + + allowDiscussion = schema.Bool( + title=_(u"Allow Users to Comment"), + description=_(u"Allow users to commemt on you. Comments +are shown at the end of each page"), + required=True, + default=True, + ) + +and added this class: + +from plone.app.discussion.browser.comments import CommentsViewlet +class ConversationView(object): + """ Ability to either allow / disallow comments based on schema +option + """ + def enabled(self): + return getattr(self.context, 'allowDiscussion', False) +