incubator-jspwiki-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Janne Jalkanen <Janne.Jalka...@ecyrd.com>
Subject Re: capturing output of a plugin in a page variable
Date Tue, 03 Mar 2009 19:50:48 GMT


D'oh.  Now I understood what you meant :-)

There are two techniques you could use.

1) Create a custom PageFilter which does a  
wikiContext.setVariable("name",  
extractRealName(wikiContext.getPage().getName()) in preTranslate().  
This effectively creates a "{$name}" variable on every single page.

2) Create a plugin which does the same.  So you could say

[{PageName var="name"}]

and the PageName plugin would then put the page name into the "name"  
variable.  See the Counter plugin for an example how this can be done.

/Janne

On Mar 3, 2009, at 21:46 , Janne Jalkanen wrote:

>>
>> What I want is:
>>
>> [{SET name='[{PageName}]'}]
>> [{$name}]
>>
>> Unfortunately, all I get is 'PageName'.
>
> Almost!
>
> [{SET name='{$PageName}'}]
> [{$name}]
>
> The reason is that [ ] is a "special" sequence. Then there are many  
> kinds of special sequences:
>
> {$name} for variable
> {plugin} for plugin
> PageName for page names.
>
> Granted, this is slightly illogical.
>
> /Janne


Mime
View raw message