create new tag
, view all tags

Feature Proposal: Make view topic actions customizable


Installations or users may want to add site-specific actions without having to rewrite the templates. For example, on our site there is a link in the topic actions that allows registering this topic in ones notifications.


  • Define topic actions in topic, e.g., TWiki.WebActionBar
  • Define tool bar in topic, e.g., TWiki.WebToolBar
  • Include these topics in view.pattern.tmpl
  • To make this work, the first call to handleCommonTags() needs to be moved before the construction of %EDITTOPIC% etc. in lib/TWiki/UI/View.pm

-- ThomasWeigert - 19 Feb 2005

Impact and Available Solutions

Note: Patch is attached as flexible_actions.diff. The patch is against the Cairo release.


Will provide if accepted.


Sample TWiki.WebActionBar

%EDITTOPIC% %TMPL:P{"sep"}% <a href="%SCRIPTURLPATH%/attach%SCRIPTSUFFIX%/%WEB%/%TOPIC%">Attach image or document</a> %TMPL:P{"sep"}% <a href="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%?skin=print.pattern%REVARG%">Printable version</a> %TMPL:P{"sep"}% <a href="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%?raw=on">Raw text</a> %TMPL:P{"sep"}% <a href="%SCRIPTURLPATH%/oops%SCRIPTSUFFIX%/%WEB%/%TOPIC%?template=oopsmore&param1=%MAXREV%&param2=%CURRREV%">More topic actions</a><br />Revisions: %REVISIONS% %TMPL:P{"sep"}% <a href="%SCRIPTURLPATH%/rdiff%SCRIPTSUFFIX%/%WEB%/%TOPIC%">Total page history</a> %TMPL:P{"sep"}% <a href="%SCRIPTURLPATH%/search%SCRIPTSUFFIX%/%WEB%/SearchResult?scope=text&amp;regex=on&amp;excludetopic=%TOPIC%&amp;search=%SPACEDTOPIC%%5B%5EA-Za-z0-9%5D">Backlinks</a>

Sample TWiki.WebToolBar

   *<a href="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%WEB%/%INCLUDINGTOPIC%?skin=print.pattern%REVARG%">Printable</a>* </div><div class="twikiRevInfo"><span class="twikiGrayText"><span class="twikiToolbarElem"><nop>%WEB%.%INCLUDINGTOPIC%</span><span class="twikiToolbarElem">%REVTITLE%</span><span class="twikiToolbarElem"><a href="#TopicEnd">topic&nbsp;end</a></span></span></div>


Note that there are two problems with this proposal:

  • %REVINFO% cannot be shown using this scheme, as it would take that from the included topic defining the tool bar.
  • Albeit I cannot see it in the HTML generated, there is a line feed added between the two parts of the tool bar.


This is a good idea, (and similiar to WebControlBottomBar). WebControlBottomBar never actually made code because I wasn't going to code it only to have it rot in the patch queue.

Now, I appreciate that you have provided code, but because Dakar is quite different to Cairo I am hesitant to even look at your code.

Besides which, we don't really check in patches for each other now. Not since the DevelopBranch made reality. And, we've known you long enough to know you to be sure you have no malintent!

So, please feel free to fill in ThomasWeigertWouldLikeToCheckIn: that way you will have the (almost wiki-like) power to make your changes yourself.

-- MartinCleaver - 19 Feb 2005

Note that this patch is not doing exactly what is suggested in WebControlBottomBar, as it takes the bottom bar from the TWiki web.

Actually, I think that the way topics are included in the layout currently is a mistake. You have to hardwire in which web to take them from. I think the mechanism for templates is preferable, where you would take the topic from a web, and if it is not found, then from the TWiki web.

Note that, e.g., for the bottom bar in general you would like to have the topics in all webs to be consistent by default, but there may be special webs where you might want to add or delete certain actions.

I think this needs a rethink. One could handle this by adding several possible webs to %INCLUDE%, or by extending the template include mechanism to alternatively search the data directory.

-- ThomasWeigert - 19 Feb 2005

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2005-02-19 - ThomasWeigert
  • 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.