cancel
Showing results for 
Search instead for 
Did you mean: 

Enable and disable create-content menu item

larsg_
Champ in-the-making
Champ in-the-making
Hello,

I extended the create-content menu by adding items to create instances of specialised object types:


<alfresco-config>
  <config evaluator="string-compare" condition="DocumentLibrary">
    <create-content>
      <content id="new_my_Folder" index="1" type="javascript" label="New My Folder">
        <param name="function">onNewMyFolder</param>
      </content>
    </create-content>
  </config>
</alfresco-config>


But what can I do to dynamically enable/disable that menu item depending on certain circumstances? For instance, I like to enable the item, if and only if the current folder (which will be the parent of the new object) has a certain type or a certain property value.

I've tried a (custom) evaluator by adding an evaluator element within the content element like this:



      <content id="new_my_Folder" index="1" type="javascript" label="New My Folder">
        <param name="function">onNewMyFolder</param>
        <evaluator negate="true">my.evaluator.isNewMyFolderAllowed</evaluator>
      </content>



It doesn't work (the menu item is visible all the time).

Is there any possibility for defining conditions regarding the visibility of a menu item?

Greetings and thanks a lot in advance
Lars
1 REPLY 1

rivarola
Champ on-the-rise
Champ on-the-rise
Hello Lars,

Did you find a solution? We have the same need.

Philippe