cancel
Showing results for 
Search instead for 
Did you mean: 

Type Folder with Content

jcantonio
Champ in-the-making
Champ in-the-making
Hello,

I read that in the "Working With Custom Content Types" tutorial that a folder can have content.

"Remember that folders are types too. Like everything else in the model, folders are types which means they can be extended. Content that “contains” other content is common."

So I added the content property to my new type al:req in my model:

<type name="al:req">
            <title>Requirement</title>
            <parent>cm:folder</parent>
            <properties>
               <property name="al:content">
                  <type>d:content</type>
                  <mandatory>false</mandatory>
                  <index enabled="true">
                     <atomic>true</atomic>
                     <stored>false</stored>
                     <tokenised>true</tokenised>
                  </index>
               </property>
       

Now I am now sure how to use it in share.
I modified the file share-config-custom.xml

        

<config evaluator="node-type" condition="al:req">
<forms>
<form id="doclib-simple-metadata">
            <field-visibility>
         …
               <show id="al:content" force="true" />
         …
            <appearance>
        …
               <field id="al:content">
                  <control>
                     <control-param name="editorAppearance">explorer</control-param>
                     <control-param name="forceEditor">true</control-param>
                  </control>
               </field>
            …
<form id="doclib-inline-edit">
            <field-visibility>
         …
               <show id="al:content" force="true" />
         …
            <appearance>
        …
   <field id="al:content">
                  <control>
                     <control-param name="editorAppearance">explorer</control-param>
                     <control-param name="forceEditor">true</control-param>
                  </control>
               </field>
      

But when I change the type of a folder to al:req I cannot add any content (other properties are showing in the Edit properties view).

Does anyone have an idea if this is possible?

Kid regards,

Jean-Claude

5 REPLIES 5

scouil
Star Contributor
Star Contributor
Hi,

When you write:
<config evaluator="node-type" condition="al:eq">

is it a typo? If not modify it to al:req since that is the actual name of your type

jcantonio
Champ in-the-making
Champ in-the-making
Thanks Scouil for your reply.
It's a typo while writing my post.

mrogers
Star Contributor
Star Contributor
One problem is that although core alfresco does support multiple properties of type d:content.   Most applications including alfresco share expect only a single property called cm:content.  

jcantonio
Champ in-the-making
Champ in-the-making
Hello,
Thanks.
I am not sure I understand your message as I actually want only one content property (whether d:content or cm:content) added to my type which extends the type Folder (not the type Content) .
Also I wonder if inline editing would be possible if I created a type extending Folder with one content property.

jcantonio
Champ in-the-making
Champ in-the-making
Hello,
I finally got around by using the richtext.ftl instead

                     <control template="/org/alfresco/components/form/controls/richtext.ftl">
                     <control-param name="editorAppearance">full</control-param>
                  </control>

Thanks,