|Title|Cannot nest [[{  }] references
|Date|24-Feb-2005 00:07:50 EET
|Version|2.1.144
|Submitter|205.243.24.110
|[Bug criticality]|EnhancementRequest
|Browser version|Firefox 1.0
|[Bug status]|ClosedBug
|[PageProvider] used|Default
|Servlet Container|Tomcat 5.5.7
|Operating System|Windows 2000
|URL|
|Java version|1.5.0_01

__Request__

I'd like to nest {{{[{ }]}}} references so that I can have

{{{
[{Plugin

body
[{something}]
more body
}] #end plugin

}}}

__Motivation__
I want a form that can create new wiki pages, and I want those wiki pages to have a predefined left menu.

I am using the [InsertLeftMenuTag] and the [NewPageHandler], but I can't accomplish this because the NewPageHandler takes the template as a Plugin Body, and the InsertLeftMenuTag requires a {{{[{SET leftmenu='...'}]}}} line.  So what I'd like to be able to write is this:

{{{
...
[{FormOutput form='newProjectForm' handler='com.mckessonaps.jspwiki.handler.newpage.NewPageHandler' 

[{SET leftmenu='ProjectLeftMenu'}]
!!!Project Description

$(description)

----
Back to [Project List]

}]

}}}

But the FormOutput tag is ended by the {{{ }] }}} of the SET, and not by the matching {{{ }] }}} after the end of the template.

__Workaround__

I cannot find a workaround to allow me to create the pages with the SET reference from a wiki form, so I'm assuming it's not possible without the ability to nest plugin markup.

----

This is not a bug, it's actually a feature.  Nested plugins may happen at a later stage (I can imagine several complicated scenarios which make things very nasty, so I'm not willing to take them in yet.)

However, you __can__ use FormSet to set any arbitrary variables to the handler.

-- JanneJalkanen

Janne is right, that technique shoudl work just fine.  Specifically your example should be doable as follows...  (I think the plugins allow nesting of the single quotes so this should work.)

{{{
...

[{FormSet form='newProjectForm' setLeftMenu='[{SET leftmenu='ProjectLeftMenu'}]'}]

[{FormOutput form='newProjectForm' handler='com.mckessonaps.jspwiki.handler.newpage.NewPageHandler' 

$(setLeftMenu)
!!!Project Description

$(description)

----
Back to [Project List]

}]

}}}

----
I tried this, but it doesn't work.  Specifically, the first {{{ }] }}} causes the parser to drop out of parsing, so there's no way to pass a string that has those two characters in it to setLeftMenu.  I'd say that's a bug, even if nested plugins aren't.

;:I hacked around this to allow one level deep plugin nesting in the NewPageHandler.  I really need to take sometime and release the McKessonApsPlugins for the 2.3 branch as they have quite a few tweaks to let out.  but releaseing means that all the docs/text needs fixed up.  Stand by, I'll get to it soon --JohnV

----

This should be fixed in 2.3.50 alpha.