Version 7.1 by Buzila Vlad on 2016/06/08

Hide last authors
Eduard Moraru 5.2 1 As a user which wants to display a panel (e.g. with some links) only on a particular page (e.g. on "Main.WebHome") you must follow the following:
Buzila Vlad 1.1 2
Eduard Moraru 5.3 3 == 1. Create or edit the panel ==
Buzila Vlad 1.1 4
Eduard Moraru 5.2 5 Make sure that the panel's code resembles the following:
6
Eduard Moraru 5.3 7 {{code language="velocity"}}
Buzila Vlad 1.1 8 {{velocity}}
9 #if ($doc.fullName == "Main.WebHome")
Eduard Moraru 5.5 10 #panelheader($services.localization.render('xe.panels.quicklinks'))
Eduard Moraru 5.3 11 * [[News>>Blog.News]]
12 ** [[Iasi>>Blog.Iasi]]
13 #if ($xwiki.hasAdminRights())
14 [[$services.localization.render('xe.panels.edit')>>path:${xwiki.getURL('Panels.newtwo', 'inline')}]]
15 #end
16 #panelfooter()
Buzila Vlad 1.1 17 #end
18 {{/velocity}}
19 {{/code}}
20
Eduard Moraru 5.2 21 The pages ##Blog.News## and ##Blog.Iasi## (from this example) should already exist, otherwise the links will point to non-existing pages.
Buzila Vlad 1.1 22
Eduard Moraru 5.2 23 The key to deciding if a panel should be displayed or not on a page is the following condition in the code which (in this case) decides that the panel should only be displayer on the homepage:
Buzila Vlad 1.1 24
Eduard Moraru 5.2 25 {{code}}
26 #if ($doc.fullName == "Main.WebHome")
27 ... panel content here ...
28 #end
29 {{/code}}
Buzila Vlad 1.1 30
Eduard Moraru 5.6 31 The final panel creation should resemble the following:
Eduard Moraru 5.8 32
Buzila Vlad 1.1 33 [[image:newpanel.png]]
34
Eduard Moraru 5.3 35 == 2. Register the panel ==
Buzila Vlad 1.1 36
Eduard Moraru 5.2 37 Add the panel to the desired column (e.g. to the right column) from ##Administration > Page Elements > Panels displayed on right column##:
38
Buzila Vlad 1.1 39 [[image:addpaneltocolumn.png]]
40
Eduard Moraru 5.4 41 == 3. Navigate to ##Main.WebHome## to see the panel displayed **only** on the homepage ==
Buzila Vlad 1.1 42
43 [[image:pageshownonmain.png]]
44
Eduard Moraru 5.2 45 In the our example, we have used ##Main.WebHome## as the page where to display the panel but you can use any other page or pages from your wiki and you can make the rule as complex as you want.

Get Connected