create new tag
, view all tags

EmbedTopicPluginDev Discussion: Page for developer collaboration, enhancement requests, patches and improved versions on EmbedTopicPlugin 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

Development discussion for EmbedTopicPlugin

-- DavidBourget - 24 Dec 2004

Thanks for contributing this Plugin.

I fixed some content on the Plugin topic, you can take that into the next release:

  • Added SHORTDESCRIPTION, needed to show summary
  • Fixed HTML of example to be XHTML compliant, e.g. only parameters="quoted" (do the same in the code)
  • Use monospaced text for user entered text
  • Added Plugin Installation Instructions section
  • Added Plugin Info section (how about adding the Benchmark numbers?)
  • Converted your signature into Interwiki link since your home page will typically not exist on a machine where the Plugin gets installed
  • Added two FIXME you should look at

Also, how about using all UPPER case like other TWiki variables? E.g. %EMBEDTOPIC{MyTopic}%

Disclaimer: I have not looked into the code, nor give much thought on what the Plugin does.

-- PeterThoeny - 24 Dec 2004

Peter: Thanks for fixing the Plugin topic. I made the requested changes, except for one thing: currently the tags are not case-sensitive, and I find this more convenient than switching to capitals. I also fixed other problems and added some minor features.


  • To implement some sort of template system or more configuration variables for the rendering.
  • To test more metadata handling and security.

-- DavidBourget - 26 Dec 2004

Thanks David. I've wanted something to do this for some time.

  • The demo topics should be prefixed with Embed Topic or be installed in the sandbox web by default.
  • You should delete all the DISABLE_ methods - they only slow loading of the plugin. (The OoPlugin base class will eliminate the need for these redundant stubs)
  • It would be nice to handle renames of inserted topics, but I don't know how you'd implement this.

re: case insensitivity: As TWiki bestows control to the plugins to detect and extract the tags they want, its up to you if you want to detect lowercase ones. In time we will probably have PluginsRegisteringTheirVariables - at which point enforcement of the (currently implied) rule that tags must be in upper case will be handled centrally. Indeed, Dakar might see this as I see DevelopBranch has some sort of support for such registration.

-- MartinCleaver - 26 Dec 2004

I made the changes Martin suggests.

Renaming: at this time the only limitation is that one cannot rename an embedded topic simply by editing the embedding topic. However, everything works well if you rename the embedded topic by using TWiki's function for this, as the occurences of its old name are changed. I could enable renaming from inside a topic by using the same kind of convention as for the auto-insert feature (e.g. if you write %BeginTopic{OldName--NewName)%.. OldName will be renamed to NewName before being updated). This would be faster than the normal way. The only thing is that I don't see the relevant function in the API, so I would have to bypass it.

Optimization question: Which handler is it better to use for this kind of plugin, commonTags or beforeRendering? It seems to me that commonTags is called more often, but I must say that I am not sure I understand what is the difference between the two.

Capitals: If that counts for anything, I vote for a convention to make tags case insensitive. This is more user friendly, and it seems to me that this only means adding "i" to the regex params..

-- DavidBourget - 27 Dec 2004

On commonTagsHandler vs. startRenderingHandler: This is mainly a convention:

  • commonTagsHandler is mainly used for variable expansion (your case)
  • startRenderingHandler and *PREHandler are mainly used for rendering TWikiML into HTML.

-- PeterThoeny - 01 Jan 2005

checked .zip into CVS

-- WillNorris - 27 Jun 2005

This plugin may be useful in combination with SectionalEditPlugin and the other plugins made by ThomasWeigert.

-- FranzJosefSilli - 27 Jun 2005

There are no appraisals for this plugin. Has anyone tried it?

-- MartinCleaver - 06 Nov 2005

Ok... looking good...

-- MartinCleaver - 07 Nov 2005

Hmm. This uses BeginTopic{TopicName} ... End{TopicName} - something like BEGINEMBED{} .. ENDEMBED{} would be more consistent, as it has EMBED in both topics.

Re: The vote for tags to be case insensitive, how about starting a topic... e.g. CaseInsensitiveTags ?

-- MartinCleaver - 07 Nov 2005

(1) I really love this plugin. I have quickly grown dependent on it.

(2) Problem report: this, EmbedTopicPlugin, does not set up the parent meta-data when it creates the subpage. I recommend that it do so, and that, by default, the parent be the first page that was being processed - the page from which EmbedTopicPlugin was invoked.

(3) I have observed myself repeatedly performing the following actions:

  1. In some parent page, I create a link to a notexisting NewTopic
  2. In this parent, I use EmbedTopic to create the first cut
  1. I view the parent, which creates NewTopic
  2. I edit the parent, removing the Embedded Topic
      i.e. I often use EmbedTopicPlugin just once, to create the topic.

      Perhaps this should be a special option?

  1. Just like INCLUDE, EMBED needs the ability to adjust heading levels.

-- AndyGlew - 18 Mar 2006

Minor Bug or Misfeature: EmbedTopicPlugin Loses TOC

I love EmbedTopicPlugin. I'm using it heavily.

However, I notice the following lossage: the %TOC% variable provides a TOC that spans INCLUDEs. It does not span %BeginTopic{foo}%.

I think that it will be essential to fix this eventually.

-- AndyGlew - 31 Mar 2006

By the way, I am surprised that %TOC% does not spab embeds. I would have thought that embeds were performed first, then INCLUDEs, and only finally TOCs.

-- AndyGlew - 31 Mar 2006

Inspired by EmbedTopicPlugin


-- AndyGlew - 31 Mar 2006

AttachContentPlugin is related.

-- MartinCleaver - 20 Jul 2006

Edit | Attach | Watch | Print version | History: r16 < r15 < r14 < r13 < r12 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r16 - 2006-07-20 - MartinCleaver
  • 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.