1
votes

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?

Thanks!

2

2 Answers

2
votes

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>
1
votes

you need to add another formid (doclib-simple-metadata):

 <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>
        <edit-form template="../documentlibrary/forms/doclib-simple-metadata.ftl" />
        <appearance>
           <field id="cm:title">
              <control template="/org/alfresco/components/form/controls/textfield.ftl" />
           </field>
           <field id="cm:description">
              <control>
                 <control-param name="activateLinks">true</control-param>
              </control>
           </field>
           <field id="cm:taggable">
              <control>
                 <control-param name="compactMode">true</control-param>
                 <control-param name="params">aspect=cm:taggable</control-param>
                 <control-param name="createNewItemUri">/api/tag/workspace/SpacesStore</control-param>
                 <control-param name="createNewItemIcon">tag</control-param>
              </control>
           </field>
           <field id="cm:categories">
              <control>
                 <control-param name="compactMode">true</control-param>
              </control>
           </field>
        </appearance>
     </form>

Cheers, jan (@alfrescian)