Hi,
If you don't mind providing the change on the server side then I'd suggest
copy the template 'layoutExtraVars.vm' from the template folder of your
wiki into your skins folder (if you don't have your own its possibly
'colibri').
Then copy exactly your code into that - That's all.
If you you don't have access to the server or you don't want to change there
you might also try
#if(!$hasEdit)
#set ($docextras="[]")
#end
but you need to apply this on all of your pages.
There may be differences in rendering depending on the XWiki version though.
regards
Andreas
Am 02.03.2011 15:40, schrieb Wouter de Vos:
Hi all,
Question:
Is it possible to execute a velocity code on my entire wiki?
Background:
I want to disable comments-attachments-etc for users without editing
rights, but keep it visible for people with editing rights.
Thanks to Ricardo I found this code at
http://www.mailarchive.com/users@xwiki.org/msg13732.html
#if($hasEdit)
#set ($showcomments="yes")
#set ($showattachments = "yes")
#set ($showhistory="yes")
#set ($showinformation = "yes")
#else
#set ($showcomments="no")
#set ($showattachments = "no")
#set ($showhistory="no")
#set ($showinformation = "no")
#end
I put it in a single page and it works perfectly, but I want to use it
for my entire wiki and obviously do not want to put a velocity script
in each and every page.
I hope someone can help me out !
Thanks in advance,
Wouter
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users