How to show Page tree and hide other options in Sidebar by default for all Spaces
Purpose
By default, the space sidebar shows Child Pages and a few other options like Pages, Blog, Calendars, Space Shortcut, and Space Shortcuts.
If a user or space admin want to show the Page Tree, and hide the other options, they will have to go to each space and change it manually.
Solution
- We can instead use CSS to hide the links that we do not want by default
- Use the Page Tree macro to add a Page Tree to the sidebar instead.
Steps
- To hide the other default options from the sidebar
Add the CSS below in the Global Stylesheet (Confluence_BaseURL)/admin/viewstylesheet.action
.main-links-section {display: none; } .quick-links-wrapper {display: none; } .ia-secondary-container.tipsy-enabled {display: none; }
To show the Page Tree, we use the macro in the Sidebar, header, and footer section
{pagetree:sort=natural|excerpt=true|reverse=false|startDepth=3|expandCollapseAll=true|searchBox=true}
- The result would be something like below, for all Spaces.
We can further configure the Page Tree macro to hide the search box and the other options like sort, depth, and show or hide the expand, collapse all option.