cancel
Showing results for 
Search instead for 
Did you mean: 

Do create folder form for custom type folder

faxeur1986
Champ in-the-making
Champ in-the-making
In Alfresco share, I have a type:

      <type name="tuto:espace">
        <parent>cm:folder</parent>
        <properties>      
            <property name="tuto:coteEspace">
               <title>Cote Espace</title>
               <type>d:text</type>
            </property>       
        </properties>
      </type>  


How can I put this type like a default folder created with it property in new folder form  ?

When I try to create a folder it's the cm:folder which is created.
5 REPLIES 5

afaust
Legendary Innovator
Legendary Innovator
Hello,

to use your folder type as the default for the "New Folder" action, you have to adapt the onNewFolder JavaScript function in the Alfresco.DocListToolbar Share UI component. You can either modify the toolbar.js to do this (not recommended) or setup a Surf extension module to load custom JS, which overrides the Alfresco.DocListToolbar.prototype.onNewFolder function.
The essential thing to change is the "itemId" in the template URL of the form dialog - this needs to be your new type. Additionally, you need to have the model-type form configured with an id of "doclib-common".

Regards
Axel

douglascrp
World-Class Innovator
World-Class Innovator
Axel, how are you?

I'm trying to implement this feature, but I need to keep the default behavior, allowing users to create both ootb folder objects and my custom type folder.

Do you know how to implement that?

Thank you in advance.

kpagratis
Champ in-the-making
Champ in-the-making
Could you expand on this answer?  I think I have the javascript written correctly but can't figure out how to setup the extension module.  Also, the toolbar is provided by a webscript.  Wouldn't I have to override that as well?

This tutorial shows how to override/customize document library widget. The tutorial uses DocumentList widget as example. You should customize DocListToolBar instead. Then you can follow Axel's suggestion to take care of itemId and doclib-common.

Customizing a Surf JavaScript Widget in the Document Library | Alfresco Documentation