Wiki source code of Add some links in a panel and display them only in a particular page
Version 1.1 by Buzila Vlad on 2016/05/31
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | As a user which wants to display a panel with links to pages only on a particular page you must follow the following : | ||
2 | |||
3 | 1) Create a new panel with this code content : | ||
4 | |||
5 | {{code}} | ||
6 | {{velocity}} | ||
7 | #if ($doc.fullName == "Main.WebHome") | ||
8 | #panelheader($services.localization.render('xe.panels.quicklinks')) | ||
9 | * [[News>>Blog.News]] | ||
10 | ** [[Iasi>>Blog.Iasi]] | ||
11 | #if ($xwiki.hasAdminRights()) | ||
12 | [[$services.localization.render('xe.panels.edit')>>path:${xwiki.getURL('Panels.newtwo', 'inline')}]] | ||
13 | #end | ||
14 | #panelfooter() | ||
15 | #end | ||
16 | {{/velocity}} | ||
17 | {{/code}} | ||
18 | |||
19 | Pages Blog.News and Blog.Iasi must exist when calling them | ||
20 | |||
21 | Condition | ||
22 | {{code}}#if ($doc.fullName == "Main.WebHome"){{/code}} | ||
23 | should be put in order to show panel only on home page | ||
24 | |||
25 | Final panel creation should resamble the following : | ||
26 | |||
27 | [[image:newpanel.png]] | ||
28 | |||
29 | 2) Add the panel to the desired column from Administration - Page Elements - Panels displayed on right column : | ||
30 | |||
31 | [[image:addpaneltocolumn.png]] | ||
32 | |||
33 | 3) Navigate on Main.WebHome in order to see the panel only on homepage . | ||
34 | |||
35 | [[image:pageshownonmain.png]] | ||
36 | |||
37 | 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 . |