[xwiki-users] Velocity templates for skin
Hi, First: could you validate my understanding. When a document url is requested XWIKI will get the document from the database and start applying velocity-templates. It will look, according to skin-setting, down a "template path" and if a programmer did not put a "modified" template on the path it will end in the templates directory (xwiki/templates) A programmer can put a template on the path by putting a rightly-named *.vm file in a directory in skins directory (xwiki/skins/toucan or xwiki/skins/#####) (where ##### is the name of the skin) A programmer can also put a template as a object in a xwiki-page of class XWiki.XWikiSkins You create a TextArea with the same name as the original template, without the vm extension The mother(s) of all templates are view.vm, edit.vm, preview.vm and save.vm? xwiki will always only apply the first found template of a certain name, meaning if you put some script in header object in the xwiki page of your skin it will ignore the header.vm files on the file system? This would imply that you best first copy the orginal script into the text-area field and then make your changes? Would this practise not lead to missing out on features of newer xwiki versions, assuming that the template-scripts are also improved? Or is the programmer forced to, with each upgrade, examine his/her scripts against the scripts in the templates directory? What is best practise here? Second; If you put also graphical elements, CSS scripts in the XWiki.XWikiSkins page of your skin how does xwiki know if it is a velocity-script, a css or a graphical element? Gerritjan
Hi, First : I have the same understanding you have ... :) Of course if you customize a template, you will have to check and merge if needed when you migrate to a newer version, but it does not happen too often (in my use cases at least). It's just the same when you customize a page that belongs to the default pages in default wiki .xar. A good practice is to have a list of the customisations you do, and to avoid them when possible (or to fix to a specific xwiki version, but I don't like this solution). Second : I'm not sure to understand ... For me xwiki look after resources (css, images ...) by their name and might find them in your skin page or in your skin folder in server or whatever ... -- View this message in context: http://n2.nabble.com/Velocity-templates-for-skin-tp2971186p3019121.html Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (2)
-
Gerritjan Koekkoek -
jerem