-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhide-sections.vtl
80 lines (65 loc) · 3.03 KB
/
hide-sections.vtl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#** ===========================================================================
HIDE SECTIONS
This Confluence user macro hides different Confluence sections of your page.
Version: 1.1.0
Updated: 2021-01-09
Author/s: George Lewe
Source: https://github.com/glewe/confluence-user-macros
License: GNU LGPLv3
Macro Body processing: No macro body
*#
#** ---------------------------------------------------------------------------
PARAMETER
*#
## @param HideBreadcrumbs:title=Hide Breadcrumbs|type=boolean|desc=Select to hide the breadcrumbs section.|default=false
## @param HideChildren:title=Hide Children|type=boolean|desc=Select to hide the children section.|default=false
## @param HideComments:title=Hide Comments|type=boolean|desc=Select to hide the comments section.|default=false
## @param HideLabels:title=Hide Labels|type=boolean|desc=Select to hide the labels section.|default=false
## @param HideLikes:title=Hide Likes|type=boolean|desc=Select to hide the likes section.|default=false
## @param HideModification:title=Hide Modification Info|type=boolean|desc=Select to hide the modification info section.|default=false
## @param HideTitle:title=Hide Page Title|type=boolean|desc=Select to hide the page title.|default=false
## @param HideSidebar:title=Hide Sidebar|type=boolean|desc=Select to hide the sidebar.|default=false
## @param HideToolsMenu:title=Hide Tools Menu|type=boolean|desc=Select to hide the tools menu.|default=false
#** ---------------------------------------------------------------------------
PROCESS INPUT
*#
#set ($hideScripts="")
#set ($hideStyles="")
#if ($paramHideBreadcrumbs==true)
#set($hideStyles=$hideStyles+"div#breadcrumb-section{display:none;}")
#end
#if ($paramHideChildren==true)
#set($hideStyles=$hideStyles+"div#children-section.pageSection{display:none;}")
#end
#if ($paramHideComments==true)
#set($hideStyles=$hideStyles+"div#comments-section{display:none;}")
#end
#if ($paramHideLabels==true)
#set($hideStyles=$hideStyles+".label-list{display:none;}")
#end
#if ($paramHideLikes==true)
#set($hideStyles=$hideStyles+"div#likes-section{display:none;}")
#end
#if ($paramHideModification==true)
#set($hideStyles=$hideStyles+"li.page-metadata-modification-info{display:none;}a#content-metadata-page-restrictions{display:none;}a#content-metadata-attachments{display:none;}")
#end
#if ($paramHideTitle==true)
#set($hideScripts=$hideScripts+"document.getElementById('title-text').innerHTML=' ';")
#end
#if ($paramHideSidebar==true)
#set($hideStyles=$hideStyles+".ia-fixed-sidebar {display: none;}.ia-splitter #main,.ia-splitter #footer{margin-left:0px !important;}")
#end
#if ($paramHideToolsMenu==true)
#set($hideStyles=$hideStyles+"a#action-menu-link {display: none;}")
#end
#** ---------------------------------------------------------------------------
OUTPUT
*#
<!-- User Macro: Hide Sections START -->
#if ($hideStyles!="")
<style type="text/css">$hideStyles</style>
#end
#if ($hideScripts!="")
<script>$hideScripts</script>
#end
<!-- User Macro: Hide Sections END -->