AnsweredAssumed Answered

Enable and disable create-content menu item

Question asked by larsg. on Nov 5, 2014
Latest reply on Jul 5, 2016 by rivarola
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

Outcomes