cancel
Showing results for 
Search instead for 
Did you mean: 

category.ftl problem

woody
Champ in-the-making
Champ in-the-making
Hi all

today I'm trying to use the categoy control in a form, but I cannot be ale to add my custom categories list.

First I've add a simply field to my custom model


<property name="my:qualification">
               <type>d:text</type>
</property>

then, in share-form-config.xml I add


<field id="my:qualification" label="Main position">
   <control template="controls/category.ftl">
   </control>
</field>

And then I add my category list within the file "Repository/config/alfresco/bootstrap/categories.xml" in this way

 
<cm:category>
   <cm:name>Qualify</cm:name>
      <cm:subcategories>
   <cm:category>
      <cm:name>Model</cm:name>
        </cm:category>
   <cm:category>
          <cm:name>Promoter</cm:name>
   </cm:category>
   <cm:category>
        <cm:name>Special</cm:name>
        <cm:subcategories>
         <cm:category>
            <cm:name>Artists</cm:name>
                            <cm:subcategories>
                  <cm:category>
                       <cm:name>Actor</cm:name>
                  </cm:category>
                  <cm:category>
                     <cm:name>Clown</cm:name>
                      </cm:category>
                  <cm:category>
                     <cm:name>Mage</cm:name>
                  </cm:category>
               </cm:subcategories>
           </cm:category>
      </cm:subcategories>
         </cm:category>
   </cm:subcategories>
</cm:category>

After a correct deploy, nothing happen in the popup control managing categories in share form. Why?

Where I have to change this category list?
Is also possible to hide all other categories in the popup frame? I would like to see only my custom category list.

Maybe this is not the right use of category, but is exactly what we need for that kind of filed (UI speaking).

thx
3 REPLIES 3

mikeh
Star Contributor
Star Contributor
Why are you trying to create your own property to hold categories? Just add the "cm:classifiable" aspect to your custom type.

Thanks,
Mike

woody
Champ in-the-making
Champ in-the-making
Why are you trying to create your own property to hold categories? Just add the "cm:classifiable" aspect to your custom type.

Thanks,
Mike

Well I simply need a multi-value text field to store the "job" metadata info. But what I need to select the job type is a tree like selector, exactly as the category.ftl control (for share).

This field, also without the cm.classifiable aspect, works well if I select a language or country category.

Now I only would like to add my own categories, to use the control with my tree-list of jobs. Of course if it's possible to set the root element of the category.ftl control to my own "job" category list.. it's better.

At the moment, modifying the  categoris.xml, as I posted above, new categories are not shown in the control created by category.ftl template.

mikeh
Star Contributor
Star Contributor
You can use the Explorer client to manage categories instead of bootstrapping them in. This also lets you remove ones you don't want or need.

Thanks,
Mike