Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Hide items in option menu

Julian Weiss October 22, 2018

How do I hide all the option items (Attachments, Page History, Page Information, View in hierarchy, etc.) except for Export to PDF?

4 answers

1 accepted

3 votes
Answer accepted
Mirek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 22, 2018
Julian Weiss October 22, 2018

Thanks

Julian Weiss October 22, 2018

Just tried it and it removes the space tools. I need to remove the options from the top right except for Export to PDF.

Mirek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 23, 2018

Hi @Julian Weiss,

Of course it it working :) .. Probably you are hiding the wrong menu item.. Below are actually two options that you (and everyone reading this) can use to hide items.

Option A

  • Hide items one by one
  • Keeping the Menu at the top right

Example code:

JavaScript hack

<script type="text/javascript">
    AJS.toInit(function(){
      if (AJS.params.remoteUser == ''){
        AJS.$('#action-menu-primary').hide();
        AJS.$('#view-attachments-link').hide();
        AJS.$('#action-view-history-link').hide();
        AJS.$('#action-page-permissions-link').hide();
        AJS.$('#view-page-info-link').hide();
        AJS.$('#view-in-hierarchy-link').hide();
        AJS.$('#action-view-source-link').hide();
        AJS.$('#view-resolved-comments').hide();
        AJS.$('#action-view-storage-link').hide();
        AJS.$('#action-export-word-link').hide();
        AJS.$('#import-word-doc').hide();
        AJS.$('#action-copy-page-link').hide();
        AJS.$('#action-move-page-dialog-link').hide();
        AJS.$('#action-remove-content-link').hide();
        AJS.$('#action-menu-modify').hide();
      }
    });
</script>

Output:

export_to_PDF.png

Option B

  • Hide entire action menu
  • Use User Macro to create a dynamic link to Export to PDF that can be used on a page in place where you want

 

Example code:

JavaScript hack

<script type="text/javascript">
    AJS.toInit(function(){
      if (AJS.params.remoteUser == ''){
        AJS.$('#action-menu-link').hide();
      }
    });
</script>

User Macro

## Macro title: Show simple link to Export to PDF
## Macro has a body: N
## Body processing: No macro body
## Output: Link to export to PDF
##
## Developed by: Mirek (Community Champion) for Atlassian Community
## Date created: 23/10/2018
## URL: https://community.atlassian.com/t5/Confluence-questions/Hide-items-in-option-menu/qaq-p/920803#M123028

<a href="$req.contextPath/spaces/flyingpdf/pdfpageexport.action?pageId=$content.id" >Export this page to PDF</a>

 Output:

export_to_PDF_02.png

I hope it helps.

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 22, 2018

You will need to use a theming App to re-skin the pages, drawing up menus that do not include the functions (or not having a menu at all)

I would strongly recommend not doing this - it will frustrate your users to have useful functions removed.

Mirek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 23, 2018

@Nic Brough -Adaptavist-, I agree that it might frustrate users if something is not showing however mostly they are actually not Confluence power users and most of them do not know which option is where and what permission is required to do something. If @Julian Weiss want to hide this for anonymous users it is reasonable. Actually this is just hiding, if someone is clever enough he can still show things on specific actions or use direct URL to action. It is all just JavaScript... See simple 2 examples that I provided in my answer to see how it can be done without theming app.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 23, 2018

>most of them do not know which option is where and what permission is required to do something

That's fine, if you remove their permissions, they will only be offered options (hopefully well named ones) that they can use.  I would push back and question

  • why the handful of options they can still see are still there if the permissions are correct
  • Of the remaining permissioned options, why there's any benefit in removing them
Mirek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 23, 2018

Hmm.. Not sure if I follow your question Nic, but overall it is all about the UI not permissions. Take a look on Atlassian Documentation (that is Confluence based) and try to answer why it looks like this (not default Confluence documentation theme like it was for many years). For me old was better to use that now I need to use the new view.. I do not see hierarchy or a page, attachments or page history anymore.. Everything was handful even that did not do any damage. Atlassian just decided to "make it simple" for everyone.

In general someone might not like default menus and it is their decision what they show and what they hide (or allow) for specific group of users either by permissions or UI changes.

On the other hand I know people that like only to see things that they use. For one of the customers for example one single high senior VP did not like Confluence default dashboard and the solution was to hack the UI only for him even there are very useful information (from the Atlassian point of view)

So as soon as you control that it is fine.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 23, 2018

I was concentrating on the options you can remove with permissions.

But for things people not controlled with permissions, I don't understand why anyone would want to remove options that people find useful.

0 votes
Julian Weiss October 23, 2018

Thanks everyone for the inputs. Combining together I resolved it with the following defined in the stylesheet for the space:

<style type="text/css">
#action-menu-primary { display: none !important; }
#view-attachments-link { display: none !important; }
#action-view-history-link { display: none !important; }
#view-page-info-link { display: none !important; }
#view-in-hierarchy-link { display: none !important; }
#action-view-source-link { display: none !important; }
#view-resolved-comments { display: none !important; }
#action-export-word-link { display: none !important; }
</style>

0 votes
Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 22, 2018

Really curious about the use model for removing all these options.

Visibility of those items is also controlled via permissions. So if there are a set of users you want to restrict these options from, set their permission levels to not allow attachments, for example.

Julian Weiss October 22, 2018

We want to restrict anonymous users to just search and export to PDF functionality.

Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 22, 2018

What permissions do you have currently set for anon users?

Julian Weiss October 23, 2018

View only.

Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 23, 2018

And view only doesn't disable those menu items?

And unless you have export space permissions enabled for anon, they will not be able to create a PDF.

Julian Weiss October 23, 2018

Nope - the site is https://kb.ctera.com/. It is still being developed but you can see it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events