Hi, Is there a way to add new menu item to user profile dropdown?
Can somebody pelase give a hint on how to achive this?
Content Server Version: 16.2.6 (2018-09), build 536
Thanks
We are also looking for a way to add to the Profile Menu. The was mention in a previous post that it should be in an update and made reference to LPAD-52872.
If anyone cna proivide some insight on this or even how you might add a new icon with menu that could be helpful.
There is no example in the SDK, but a menu item to the user menu can be added since CS 16.2.2. You can have a look at the "hello" and "rename" commands in the SDK. They explain, how to add a command and place a button to the toolbar, which executed the command on click. Instead of the toolbar part, you will add a menu item to the menu. Let us develop a "Greetings" component using "greet" as the module prefix. Let us assume, that the command "greet-hello" has been already added. Then do this:
1. Add a module declaring additional menu items to the user menu - src/commands/hello/hello.profile.toolitems:
define(function () { return { profileMenu: [ { signature: 'greet-hello', name: 'Hello' } ] }; });
2. Make the new module public to get it loadable from csui - refer to it in src/bundles/greet-all.js:
'greet/commands/hello/hello.profile.toolitems', ...
3. Register the new module to be loaded by the user menu - refer to it in src/greet-extensions.json:
"csui/widgets/navigation.header/profile.menuitems": { "extensions": { "greet": [ "greet/commands/hello/hello.profile.toolitems" ] } }, ...
When you implement the method enabled() in the command, you will have only limited access to the page. For example, you will not be able to get the selected nodes from the nodestable widget, which would be on the page. (User menu is not intended for commands, which process selected nodes. They should be placed on the nodestable toolbar.) User menu is meant for global command. You can check user information of other models available in context. User menu is refreshed (and your enabled() method gets called) whenever a page (perspective) navigation takes place - whenever the context is fetched.