incubator-jspwiki-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Paige <bobpa...@gmail.com>
Subject Re: capturing output of a plugin in a page variable
Date Tue, 03 Mar 2009 20:25:24 GMT
Great! Works like a charm.

I think I'll add this 'var=' behavior to all my plugins!

-- 
Bobman

On Tue, Mar 3, 2009 at 2:50 PM, Janne Jalkanen <Janne.Jalkanen@ecyrd.com>wrote:

>
>
> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message