xWiki action view - query parameter to display page without panels

Hello there

https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Architecture/URL%20Architecture/Standard%20URL%20Format/#HAction:view

lists most or maybe all of the actions and supported query strings. I’m looking for an option to display a page in “full screen” in the sense that the columns are not rendered.

Sure, I could modify the “look and feel” of the page, but this will be permanent. Some of the pages contain tables or pictures that need more space to render nicely. Providing an URL to display the page without columns would be a cool feature - that maybe already exists?

Thank you

Not sure if this comes close to what you want to do, but appending ?xpage=print shows the page in print view. This is without the panels, but without the header containing the logo and the search bar, too.

OMG, didn’t think of this approach - nice one. Unfortunately, the top bar, page actions and page additional information (Comments, Attachments, History and Information) disappear too, but hey, better than nothing - thank you for the hint.

Changing page properties even using code will generate a new version of the page properties I assume, which is probably not a good idea over time … maybe I’ll post a feature request. Not sure if this is a common use case though …

Again, thank you

Actually it might be possible to do some more fiddling; if you look at the code in templates/print.vm, which is used by appending the xpage=print … well I got the idea it would be possible to scrap the usage of the print.css and just hide the panels. Somehow using the velocity variables like #set($showLeftPanels = "0" did not work for me as I thought it should.

However if I create a file, say, simple.vm with the contents:

## Don't display panels in print view
#set($showLeftPanels = "0")
#set($showRightPanels = "0")
<style type="text/css">
  .panels { display: none }
  body#body .main { width: 100% !important; left: 0 !important; }
</style>
#template("view.vm")

and attach that file to the page under .../view/XWiki/DefaultSkin, then appending ?xpage=simple does something a bit close to what you want to do.

However it is quite a bad hack (if you look at the source code, you can see the <style> is inserted before the opening <html>, which of course makes it invalid HTML. Hmm … I think something better should be possible. A button toggeling the class hidelefthideright via javascript might work better than this hack. It might be possible to add something like this at some extension point at https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/ExtensionPoint/

Example:
https://playground.xwiki.org/xwiki/bin/view/Main/WebHome?xpage=plain&htmlHeaderAndFooter=true

Is that what you’re looking for? It bypasses the skin and renders into HTML. Of course since the skin is bypassed you also don’t have the hamburger menu at the top right.

If what you want is the current skin but without the panels then you could override the $showLeftPanels and showRightPanels variables defined in layoutvars.vm. You do that by adding a layoutExtraVars vm in your skin:

#if (... some condition...)
  #set ($showLeftPanels = false)
  #set ($showR=ightPanels = false)
#end

A much better option, the canonical way, is to go to the Admin UI and set that you don’t want side panels (see https://extensions.xwiki.org/xwiki/bin/view/Extension/Panels%20Application#HConfiguration). Know that this can be done at the level of the page too in the page administration too :slight_smile: So you can decide where you want panels or not…

Thank you Clemens, Vincent for the ideas and profound technical information.

As I’m not yet into xWiki that deep (skins), I’ll need a minute to play around with it as soon as time permits. My “vision” was to enable a viewer to “click” a button or a link on the page to display this very page without the Panels to have more space for the content but still retain the options that are usually available for a page (edit, …, bottom tabs).

Based on your input, I make things more complicated than necessary some times :wink:

One option is to provide some sort of “toggle” button on that page that will switch between print/html view and the standard view with all controls. If someone would like to take action, the simply need to hit that button again to get the “controls” back. Not a big deal …

I’ll report back as soon I had some time to play around a bit and know myself what I really “need”.