How to change default icon folder based on its properties?

cancel
Showing results for 
Search instead for 
Did you mean: 
billydekid
Established Member II

How to change default icon folder based on its properties?

Jump to solution

Hi,

I want to change the default folder icon by its properties with my own icon.

I have a custom folder properties ar:dirFunction.

The first one of document library view I try to change is on "detailed" version which is in share/components/documentlibrary/documentlist-view-detailed.js. In following lines:

      getDefaultFolderIcon : function DL_VR_getDefaultFolderIcon()
      {
         return "components/documentlibrary/images/folder-64.png";
      },

to

      getDefaultFolderIcon : function DL_VR_getDefaultFolderIcon()
      {
         if(properties[ar:dirFunction] === "ObjectiveDir")
             return "components/documentlibrary/images/folder-64-green.png";
         else
             return "components/documentlibrary/images/folder-64.png";
      },

But the folder's icon with specified ar:dirFunction as mentioned above is not change.

What is the correct way to solve this?

Thanks in advance.

[bayu]

1 Solution

Accepted Solutions
cesarista
Advanced

Re: How to change default icon folder based on its properties?

Jump to solution

Hi:

Maybe you can use a custom indicator, it is exactly for your purpose, which changes depending on a custom aspect, type or a property:

Document Library | Alfresco Documentation 

Regards.

--C.

View solution in original post

9 Replies
cesarista
Advanced

Re: How to change default icon folder based on its properties?

Jump to solution

Hi:

Maybe you can use a custom indicator, it is exactly for your purpose, which changes depending on a custom aspect, type or a property:

Document Library | Alfresco Documentation 

Regards.

--C.

View solution in original post

billydekid
Established Member II

Re: How to change default icon folder based on its properties?

Jump to solution

Hi Cesar,

Thank you for pointing to this subject.

[bayu]

billydekid
Established Member II

Re: How to change default icon folder based on its properties?

Jump to solution

Hi ‌, after a minutes reading, a custom indicator will only add a 16px icons in front of content/folder icon.

My requirement is to change the "big" folder icon -- a 64px icon size (the folder icon).

Is it possible?

Thanks,

Highlighted
cesarista
Advanced

Re: How to change default icon folder based on its properties?

Jump to solution

Hi Bayu:

I would not say that it is not possible, but the custom indicator is a type of Share extension that is made for that purpose. I use custom indicators in these cases. Besides, you are only considering the detailed view of the folder (when the folder icon is big), but you have also other views such as the simple view or the table view of the Document Library. With the same evaluator you may also show differences between documents via metadata templates.

Regards.

--C.

douglascrp
Advanced II

Re: How to change default icon folder based on its properties?

Jump to solution

Hello Bayu.

You haven't said how you changed the documentlist-view-detailed.js file, but I guess you did it by changing it straight inside the share folder.

If that was the case, then I believe the problem you are facing is because you just change the expanded file, and not the minified one.

What you are trying to do is doable, but I have to agree with ‌, as this will force you to make that change on all the existing views.

A custom indication will do the trick.

billydekid
Established Member II

Re: How to change default icon folder based on its properties?

Jump to solution

Hi Cesar,

Yes, off course I have also modify for another views of the Document Library.

Last, since I'm new on this issue, what's the meaning of "metadata templates" - Is it the same with applying custom model to content/folder (in Model Manager)?

[bayu]

billydekid
Established Member II

Re: How to change default icon folder based on its properties?

Jump to solution

Hi Douglas,

Thank you, I will try with the minified version :-)

My concern to replace the "main icon" is to give an eye-catching folder to users, hence he/she will quick to find and access those specific folders.

Thank you,

[bayu]

cesarista
Advanced

Re: How to change default icon folder based on its properties?

Jump to solution

Hi Bayu:

A metadata template defines a custom view based on an evaluator (for example, for a given custom type, let's say contract). The default detailed view of the Document Library is rendering a metadata template with some rows like name and title, description, categories, tags and social. You can customize templates adding for example a custom property (let's say, Contract ID). This helps to visualize specialized objects better, as custom indicators.

Regards.

--C.

billydekid
Established Member II

Re: How to change default icon folder based on its properties?

Jump to solution

Thank you