cancel
Showing results for 
Search instead for 
Did you mean: 

How to show/hide fields in simple edit metadata form

shazada
Star Contributor
Star Contributor
In the share-config-custom.xml i've defined the following:

<config evaluator="node-type" condition="zk:document">
<forms>
<form>
<field-visibility>
<show id="cm:name" />
<show id="cm:description" force="true" />
<show id="zk:nummer" />
<show id="zk:registratieDatum" />
<show id="zk:zaakType" />
<show id="zk:documentType" />
<show id="zk:vertrouwelijkheid" />
<show id="zk:richting" />
<show id="zk:subject" />
<show id="zk:object" />
<show id="zk:perceel" />
<show id="cm:taggable" for-mode="edit" force="true" />
</field-visibility>
<appearance>
</appearance>
</form>
</forms>
</config>

The form shows fine in View and Edit(full metadata edit), but in simple edit mode (on docLibrary –> edit metadata) I'm getting too many fields. I want only to show a couple of fields in simple mode and the full stack in full mode.

How can I achieve this? e.g. like the cm:content in simple mode only name, title & description and in Full mode the full stack.

Very simple to reproduce this: - Start Alfresco - Add a content - click on edit-metadata (in docLib), you will see a simple edit form - click on the upper-right corner, you will see a full edit form

My question: - How can I configure the simple edit form?
2 REPLIES 2

shazada
Star Contributor
Star Contributor
Answered at Stack: http://stackoverflow.com/questions/7737316/how-to-show-hide-fields-in-simple-edit-metadata-form

Have a look at the original share form config: tomcat/webapps/share/WEB-INF/classes/alfresco/share-form-config.xml

There you can see that the simple metadata dialog has a separate form definition. It can be set by using the form id="doclib-simple-metadata" in addition to the normal form that you already have defined.

  <config evaluator="node-type" condition="zk:document">
  <forms>
    <form>…. your full form here….</form>

    <form id="doclib-simple-metadata">
     <field-visibility>
        <show id="cm:name" />
        <show id="cm:title" force="true" />
        <show id="cm:description" force="true" />
        <!– tags and categories –>
        <show id="cm:taggable" for-mode="edit" force="true" />
        <show id="cm:categories" />
     </field-visibility>
   </form>
  </forms>
  </config>

mikeh
Star Contributor
Star Contributor
It's also worth noting the extra parameter than Jan posted:
<edit-form template="../documentlibrary/forms/doclib-simple-metadata.ftl" />
This adds a little extra padding around the form (and also the link to the full edit metadata page) for use in the pop-up dialog.

Thanks,
Mike