Hi @Julian Weiss - Welcome to the Community!
Usually you can do it with CSS orr JavaScript code added to space layout. Please take a look on this page for examples:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just tried it and it removes the space tools. I need to remove the options from the top right except for Export to PDF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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:
Option B
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:
I hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We want to restrict anonymous users to just search and export to PDF functionality.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What permissions do you have currently set for anon users?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.