Add some links in a panel and display them only in a particular page

Version 1.1 by Buzila Vlad on 2016/05/31

As a user which wants to display a panel with links to pages only on a particular page you must follow the following :

 1) Create a new panel with this code content :

{{velocity}}
#if ($doc.fullName == "Main.WebHome")
#panelheader($services.localization.render('xe.panels.quicklinks'))
* [[News>>Blog.News]]
** [[Iasi>>Blog.Iasi]]
#if ($xwiki.hasAdminRights())
[[$services.localization.render('xe.panels.edit')>>path:${xwiki.getURL('Panels.newtwo', 'inline')}]]
#end
#panelfooter()
#end
{{/velocity}}

Pages Blog.News and Blog.Iasi must exist when calling them 

Condition
#if ($doc.fullName == "Main.WebHome")
should be put in order to show panel only on home page

Final panel creation should resamble the following :

newpanel.png

 2) Add the panel to the desired column from Administration - Page Elements - Panels displayed on right column :

addpaneltocolumn.png

 3) Navigate on Main.WebHome in order to see the panel only on homepage . 

pageshownonmain.png

In the previous example it was used Main.WebHome as page to display the panel but it can be used any other page from your wiki . 

Get Connected