[xwiki-devs] How to use xpage
Hi, This is probably a newbie question but I didn't find any clear answer for me. Could someone explain to me how to use "xpage"? For example, when trying to modify user avatar this code is used: $doc.getURL('edit', 'xpage=changemyavatar') I really don't know how this works or where I can find the piece of code related to this action. Thanks, Luís Braga -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-use-xpage-tp6056768p6056768.html Sent from the XWiki- Dev mailing list archive at Nabble.com.
Hi Luís, On 02/23/2011 05:47 PM, Lukapt wrote:
Hi,
This is probably a newbie question but I didn't find any clear answer for me.
Could someone explain to me how to use "xpage"? For example, when trying to modify user avatar this code is used: $doc.getURL('edit', 'xpage=changemyavatar')
I really don't know how this works or where I can find the piece of code related to this action.
When you view a page (e.g. using an URL like /xwiki/bin/view/Space/Page) the corresponding XWiki document, i.e. Space.Page, which is stored in the database, is rendered against a velocity template from the /templates directory (inside the XWiki war). The template is chosen based on the action (view, edit, etc.) but you can overwrite this by specifying xpage=otherTemplate. So in your case $doc.getURL('edit', 'xpage=changemyavatar') the returned URL will render $doc using changemyavatar.vm rather than edit.vm . Hope this helps, Marius
Thanks,
Luís Braga
Thanks for you're help, now I'm creating new templates! Luís Braga -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-use-xpage-tp6056768p6060695.html Sent from the XWiki- Dev mailing list archive at Nabble.com.
participants (2)
-
Lukapt -
Marius Dumitru Florea