create new tag
, view all tags

ChildTopicTemplatePluginDev Discussion: Page for developer collaboration, enhancement requests, patches and improved versions on ChildTopicTemplatePlugin contributed by the TWikiCommunity.
• Please let us know what you think of this extension.
• For support, check the existing questions, or ask a new support question in the Support web!
• Please report bugs below

Feedback on ChildTopicTemplatePlugin

-- DeanCording - 04 Jun 2004

The ChildTopicTemplatePlugin appears to have problems in Cairo - it will remove the %CHILDTOPICTEMPLATE {...}% "call", but when I create the topic by clicking on the "?", it just gives me the usual Web template instead of the topic text I had in the "call".

Additionally, no DEBUGging output appeared in debug.txt (in spite of setting DEBUG = 1).

What could I have done wrong to cause these symptoms?

-- BruceDawson - 02 Sep 2004

In Cairo, ChildTopicTemplatePlugin.pm/endRenderingHandler needs to search for ...topicparent=(.*?)"><sup>\?<\/sup> instead of just ...topicparent=(.*?)">\?. (Cairo added the <sup> and the plugin hasn't been updated since.)

-- BruceDawson - 18 Sep 2004

The ChildTopicTemplatePlugin provides for adding a templatetopic to a "new" link. Should we also give it options for formtemplate, topicparent, ...?

-- BruceDawson - 20 Sep 2004

.zip checked into CVSplugins:ChildTopicTemplatePlugin

-- WillNorris - 23 Nov 2004

Plugin does not work for releases after Cairo. See this topic for the (easy) fix.

-- ShaughanLavine - 27 Feb 2005

Fixed in latest version of the ZIP. Also added more robust handling of parameters (Web and ") like

  • %CHILDTOPICTEMPLATE { "Web.NewTopicTemplate" }%

-- ChristopherOezbek - 28 Jun 2005

Thanks Christopher for creating a new ZIP. I moved your comment to this Dev topic. I did also some changes to the Plugin topic, e.g. added the version info to the table. Please take this into the next release.

-- PeterThoeny - 29 Jun 2005

Thanks Christopher and Peter for updating this. Like many things, other priorities have denied me the time to maintain this.

-- DeanCording - 18 Jul 2005

I've updated the Wiki page inside the zip file to match the version on the TWiki site.

-- DeanCording - 18 Jul 2005

Diff required for Dakar is around line 202. New attributes in the anchor tag require a modified regex. This one should be safe:

      if ($childTopicTemplate ne '') {

-- JoanTouzet - 04 Oct 2005

To allow multiple CHILDTOPICTEMPLATEs per line change line 197f to:

foreach( split /%CHILDTOPICTEMPLATE/m, $_[0]  ) {
      if (s/ *{ *\"?(\w*?\.?\w*?)\"? *}%//) {
         $childTopicTemplate = $1; 

-- ChristopherOezbek - 13 Mar 2006

I made a simple enhancement to allow specification of additional link parameters in the link as well.

-- JadeCravy - 11 Jun 2006

Just curious if this plugin is working with Twiki 4.0.3? Has the diff above been integreted into the attached version?

-- EricHanson - 28 Jun 2006

I am trying to get this plugin running with TWiki 4.0.4 (As installed in the Virtual Machine). After the code segments listed above, the plugin works correctly, but breaks ALL search results. For some reason %SCRIPTURLPATH is inserted into the middle of all the search results.

This plugin provides the functionality I am looking for, but breaking search is a bid deal. Any suggestions on changes?

-- LanceLamont - 09 Jan 2007

Here's an example of the URL that is generated for the search:


-- LanceLamont - 09 Jan 2007

I tried this Plugin with version 4.1.1, but the URLs it produced for the new links were wrong. I tracked this down to the fact that the Plugin was assuming that all the 'Create' links only contain the href value, but the newer version of twiki also has a rel="nofollow" and a title="Create this topic".

I 'fixed' this with the following diffs to the ChildTopicTemplatePlugin.pm:

< sub endRenderingHandler
> sub postRenderingHandler
<        s/<a href="(.*?)\?topicparent=(.*?)">(.*?)<\/a>/<a href="$1\?topicparent=$2\&templatetopic=$childTopicTemplate">$3<\/a>/g;
>        s/<a href="(.*?)\?topicparent=([^"]+)"(.*)>(.*?)<\/a>/<a href="$1\?topicparent=$2\&templatetopic=$childTopicTemplate"$3>$4<\/a>/g;

Hopefully someone can incorporate this change into a future release.

-- DuncanKinnear - 10 Apr 2007

This plugin has PleaseFeelFreeToModify modification policy so you could release a new version of this plugin yourself, Duncan. Thanks. wink

-- FranzJosefSilli - 10 Apr 2007

Hi, We've had troubles installing this plugin on TWiki 4.1.2 and trying to make it work.
After a couple of investigation with our System Admin we couldn't find anything. Is there a reason why it would not work with recent updates of TWiki (we have started using TWiki a couple of month ago with version 4.1.2).
We really hope some help as this is a very important feature for us (or does anyone has another plugin to suggest that does the same job ?
Thanks, Matthieu.

-- MatthieuBeimert - 22 Jun 2007

TopicCreatePlugin I think maybe can give you what you need. Also it is best to use the Support web, IRC or the ChildTopicTemplatePluginDevDev.

-- LarsEik - 22 Jun 2007

The bug reported 09 Jan 2007 by LanceLamont (search result URLs broken) is a show stopper for me too. Has anyone got any ideas? I misinterpreted DuncanKinnear to be claiming that his patch fixed that problem. It doesn't, and, on more careful reading, I don't think he intended it to.

I would appreciate an e-mail if there is news, since I don't actively monitor this list. When there is a fix, I volunteer to package it with the fixes above as a new release.

-- ShaughanLavine - 25 Jun 2007

I was able to get the plugin to work with search by wrapping everything from the foreach statement through the $_[0] assignment in an if statement:

    if($_[0] =~ m/%CHILDTOPICTEMPLATE/){
        foreach( split /%CHILDTOPICTEMPLATE/m, $_[0]  ) {

          if (s/ *{ *\"?(\w*?\.?\w*?)\"? *}%//) {
             $childTopicTemplate = $1;
          if ($childTopicTemplate ne '') {
             $result .= $_;

        $_[0] = $result;
-- ScottSeiler - 09 Oct 2007

ScottSeiler, the site interpreted some of your *s as bolding and stripped out the line breaks, so I fixed it... I've tried incorporating the patches on this page but have gotten nowhere on TWiki 4.1.1. If I make any changes to the function in question it just starts rendering pages as blank. Furthermore without any changes it doesn't seem to do anything (topics using %CHILDTOPICTEMPLATE {...}% are not taking on the form of their templates). I'm not very well versed in TWiki plugins, does anyone have any ideas?

-- ChrisGuirl - 09 Oct 2007

Thanks for fixing the formatting, Chris. The changes in my previous post work with TWiki version 4.0.5. I also changed the name of the subroutine endRenderingHandler to postRenderingHandler. With those changes, both the ChildTopicTemplatePlugin and TWiki search functionality work as expected. I'll try to keep a lookout on this page for any other feedback and offer to assist if possible.

-- ScottSeiler - 10 Oct 2007

the quotes around the template topic name made my page fail. when i removed the quotes, it works.

-- ScottGutman - 2010-08-06

I just updated the plugin:

  • use postRenderingHandler callback instead of endRenderingHandler
  • fixed link parsing for red-links
  • more robust parsing of CHILDTOPICTEMPLATE with parameters, taking some of ScottSeiler ideas
  • doc enhancements

-- PeterThoeny - 2010-08-06

This is a handy plugin, however, it would be even handier if the CHILDTOPICTEMPLATE call did not need to be present inside the main content of the topic. That puts it where a user can see it, remove it, or move it.

-- Vicki Brown - 2017-03-27

Edit | Attach | Watch | Print version | History: r25 < r24 < r23 < r22 < r21 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r25 - 2017-03-27 - VickiBrown
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.