• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.
In TWiki:Plugins/NewsPluginDev TWiki:Main/PankajPant gives an example script for the TWiki:Plugins/CommentPlugin to create news items. I reproduce it here for convenience
<input type="hidden" name="anchor" value="%GMTIME{$day$month$year$hour$min$sec}%">
%TABLE{ sort="off" tableborder="0" cellpadding="5" cellspacing="3" databg="white"}%
|  Headline:| <input %DISABLED% type="text" size="50" name="headline" />                    |
|      Text:| <textarea %DISABLED% rows="10" cols="40" name="news" wrap="soft"></textarea>  |
|           | <input %DISABLED% type="submit" value="Submit"/>                              |

<a name="%URLPARAM{anchor}%"></a>
---+++ [[%TOPIC%#%URLPARAM{anchor}%][ ==%DATE%:== %URLPARAM{"headline"}%]]

Submitted by: %WIKIUSERNAME%

It works to a degree. The part that doesn't work is that H3 lines appear as

---+++ [[%TOPIC%#11Mar2006001217][ ==11 Mar 2006:== Test 1 2 3]]
That is, the %TOPIC% isn't expanded, which in turn means that when the NewsPlugin puts the entries in the headline topic, they appear as:
   * [[%TOPIC%#11Mar2006001217][ ==11 Mar 2006:== Test 1 2 3]]
That is, they are NOT a link to the relevant part of orignal news topic.

If the headline topic is further INCLUDE'd in another topic, a front page or portal, the situation gets even more screwed up.

There are really two issues here

  1. How to get %TOPIC% to expand when you want it to
  2. How to prevent it being expanded when you don't want it to.

We seem stuck with it not being expanded when the "COMMENT" is used.

This is an enhancement request, not a patch requirement.


I disagree.
This is a case of the result not being what is expected.
The rest of TWiki can use templates that have %TOPIC% and %<nop>TOPIC% to produce the results I mention in my oints 1 & 2 above. Buit not in this situation.

Thus its at variance with what is expected and the behaviour of the rest of TWiki. I don't see how expecting it to behave like the rest of TWiki is an 'enhancement' as opposed to a 'requirement'.

Conformant and consitent behaviour is a requirement, surely?

-- AJA

No. Comment plugin follows the rules for expansion of variables on topic creation, and as you know %TOPIC% is not expanded on topic creation.

You want it to support then insertion of the generating topic name; fair enough, but that's an enhancement.

One way to do it would be to extend %COMMENT to support named parameters (like INCLUDE does). For example,

%COMMENT{target="FintleWoodleWix" topic="%TOPIC%"}%

When the COMMENT was triggered, %TOPIC would aready be expanded, and then you could use the named parameter %topic% in the comment template.

I've been thinking about doing something like this for a while now, but I haven't been able to interest a sponsor and as you know, without sponsorship things take longer to get done.


Whatever... The parser doens't do what I expect.

If I use a template line to specify the 'location': ...


and omit a value for "location" then result comes out as
<input type="hidden" name="location" value="'TOPIC%'%"
which still isn't what I expect.

And yes I've played with escapes and quotes on that one.

It works for "where=%TOPIC%" and "where=''"

So, any other suggestions for a work-aroound?

-- AJA

Without experimenting, I don't know if there is a workaround.

Reset priority to enhancement, as that is what is being requested here.


I'm bouncing this to Item3647, which is a more general solution that is also appropriate for CommentPlugin.


Summary CommentPlugin doen't treat %TOPIC% in the same wat thatthe rest of TWiki does
ReportedBy TWiki:Main.AntonAylward

SVN Range Mon, 13 Mar 2006 build 9258
AppliesTo Extension
Component CommentPlugin
Priority Enhancement
CurrentState No Action Required


TargetRelease n/a

Edit | Attach | Watch | Print version | History: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r10 - 2007-06-22 - CrawfordCurrie
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback