URL parameters: default values at loading time

Hi! I am not sure to what extent this is reasonable or not, but I would need to load some XWiki pages with some type bin parameters, namely view xpage and get htmlHeaderAndFooter to defaults plain and true.

I know that I can pass those parameters with the URL, but it forced users to store a long address. There is no sense in remembering and typing it. I would like to set those parameters by default at loading time.

Is it possible? Does it make sense for you? Thanks!

I’m not sure I understand what you mean exactly and what are your needs… :slight_smile: Obviously if all XWiki URLs have these parameters, then XWiki will not work well anymore.

That said, if you want to modify URLs you should use a web server front end and do URL rewriting (apache web server, ngingx, etc). You could also use the URLRewriteFilter, see https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/ShortURLs/#HUrlRewriteFilter

Hi! Thanks for your answer, and apologies for my poor explanation. I think you gave to me two keys to keep investigating. I would prefer to find a pure XWiki solution to avoid further complexity, but to use Nginx is also an option.

Trying to be clearer: what I want is that some XWiki pages loads always with no-default parameters. A life example, accessible online now: I would like that this page (url01; I’m also adding a screenshot for the sake of keeping a reference if the page is not only on the future):

https://portal.igfae.usc.es/xwiki/bin/view/DesksAllocation/

image

Loads always as if I use the URL (url02):

https://portal.igfae.usc.es/xwiki/bin/view/DesksAllocation/?xpage=plain&htmlHeaderAndFooter=true&outputTitle=false

image

Regardless of whether the URL does not contain the parameters xpage, htmlHeaderAndFooter or outputTitle

Thanks!

If you want a pure XWiki solution then you could use a skin just for this page (you can apply a skin for a single page). The problem of course is that once you and on this page you won’t be able to navigate elsewhere, edit it, etc.

See https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/Skins/

All you’ll need to do I think is override the view.vm template if you skin and use $doc.getRenderedContent() in it.

You can also check plain.vm and do the same as in there (with the passed parameters) and copy that in your view.vm in your skin.

Big thanks! I remember a lot of details related to skins now.

As it is not a simple task to keep the documentation updated, I preferred to start with /Documentation/Administrator Guide/Skins:

https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Skins

The concept skin document appears for the first time for an administrator in the section Changing the Skin of the document linked above. Would it be advisable to explain that feature earlier in this page and to add a link to Creating a Skin document?

As it says How to override a Skin, that method has the advantage of avoiding the need of having access to the files and the solution remains fully UI-side. That is great!

Is it also true that this method eases the update process? If an XWiki instance remains flamingo-dependent, any update of XWiki will also include skin updates, and administration has to take care only of the compatibility/functioning of changes introduced by skin documents in the look & feel of a site. Is this correct? Thanks!