Auto-create a discussion page. Something like WikiPedia ? :
<dtml-call "REQUEST.set('DiscussionSuffix' , 'Discussion' )"> <dtml-call "REQUEST.set('SuffixLength' , _.len(DiscussionSuffix) )"> <dtml-call "REQUEST.set('ViewText' , 'View Page' )"> <dtml-call "REQUEST.set('DiscussText' , 'Discuss This Page' )"> <dtml-call "REQUEST.set('CreateText' , 'Create Discussion' )"> <dtml-call "REQUEST.set('pagename','%s' % _['title_or_id'])"> <dtml-if "pagename[-SuffixLength:] == DiscussionSuffix"> <dtml-call "REQUEST.set('basename','[%s]' % pagename[:-SuffixLength])"> <dtml-call "REQUEST.set('basenameblk','%s' % pagename[:-SuffixLength])"> <dtml-call "REQUEST.set('linkname',pageWithFuzzyName(basenameblk,ignore_case=1).getId() )"> <a href="&dtml-URL1;/&dtml-linkname;"><dtml-var ViewText></a><br> <dtml-else> <dtml-call "REQUEST.set('discussname','[%s%s]' % (pagename,DiscussionSuffix))"> <dtml-call "REQUEST.set('discussnameblk','%s%s' % (pagename,DiscussionSuffix))"> <dtml-call "REQUEST.set('discusswiki',wikilink(discussname))"> <dtml-if "_.string.find(discusswiki,discussname) == -1"> <dtml-call "REQUEST.set('linkname',pageWithFuzzyName(discussnameblk,ignore_case=1).getId() )"> <a href="&dtml-URL1;/&dtml-linkname;"><dtml-var DiscussText></a><br> <dtml-else> <dtml-if "AUTHENTICATED_USER.has_permission('Zwiki: Edit pages',this())"> <a href="&dtml-URL0;/editform?page=&dtml-discussnameblk;"><dtml-var CreateText></a><br> </dtml-if> </dtml-if> </dtml-if>
ZPT --FlorianKonnertz, 2003/02/19 14:54 GMT
Very nice feature! Thanks! - Have you done it also in [ZPT]??
Re: ZPT --Ducker, 2003/02/20 00:19 GMT
It's a stand alone dtml-method on my system (I called it discusslinker), which gets called from standard_wiki_header. I have no experience with ZPT, so I won't be doing this anytime soon, but the logic isn't that difficult so it should be pretty straighforward to do:
if on discussion page: Action: Go-To main page Preface text: View Page: Linking text: wikilink(basename) else on main page: if discussion page already exists: Action: Go-To discussion Preface text: Discuss Page: Linking text: wikilink(discussname) else discussion page doesn't yet exist: if user has edit rights: Action: Create discussion Preface text: Create Discussion: Linking text: wikilink(discussname) else user doesn't have edit rights: Action: NO DISPLAY