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