Pbas
1
Hello,
I want to fill my menu entries (http://extensions.xwiki.org/xwiki/bin/view/Extension/Menu%20Application) with the document listing from a location.
Then with tree macro (http://extensions.xwiki.org/xwiki/bin/view/Extension/Document%20Tree%20Macro) I try to generate this output:
- My location
** My doc 1
*** A new level 1
*** level 1 too
** Another doc
If someone already use the code or think about a better idea?
thanks.
Anyway I wonder if this kind of code will slow xwiki displaying…
(I will limit the deph of course)
Thxs
Pascal B
Actually it might be not too bad since the menu app is using a UIX and UIX are cached (at the XDOM level).
Pbas
4
yes I tested without success:
It seem that some parameter missing in doc: http://extensions.xwiki.org/xwiki/bin/view/Extension/Children%20Macro/
#macro (children $parentDoc $level)
I failed too with:
#set ($parentDoc = $xwiki.getDocument("Mon Espace.WebHome"))
This is why I talked about document tree macro .
(I forgot my glasses at work today, this is why I failed probably )
Pbas
5
Yes thxs:
#set($MyDoc=$xwiki.getDocument("Personnalisation.Menu.Content.WebHome"))
#set ($depth = 3)
#set ($limit = 10)
#macro (children $parentDoc $level)
#foreach ($child in $parentDoc.getChildren($limit, 0))
#set ($childDoc = $xwiki.getDocument($child))
## $stringtool.repeat('*', $level) {{html}}<a href="$childDoc.getURL()">$escapetool.xml($childDoc.plainTitle)</a>{{/html}}
$stringtool.repeat('*', $level) [[$childDoc]] ($escapetool.xml($childDoc.plainTitle))
#if ($level < $depth)
#children ($childDoc $mathtool.add($level, 1))
#end
#end
#end
## Call children macro above
#children ($MyDoc 1)