cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco 5 Custom Folder Icon

4f2e4a2e
Champ in-the-making
Champ in-the-making
Hello Guys!

Thank you for this amazing community.  Ok, here comes an easy one Smiley Happy

I have a question, how can i get share to display a custom icon for a certain object type - lets say a custom folder inherited from cm:folder: xyz:folderz in Alfresco 5?
Here are the links and infos i am aware of right now on the - nothing about Alfresco 5, but here we go:
https://forums.alfresco.com/forum/developer-discussions/alfresco-share-development/add-own-content-t...
https://forums.alfresco.com/forum/end-user-discussions/alfresco-share/how-change-icon-new-folder-typ...
https://forums.alfresco.com/forum/installation-upgrades-configuration-integration/configuration/cust...

Oh and the JS-Method "DL_renderCellThumbnail", looks like this now:
Path: C:\Alfresco\tomcat\webapps\share\components\documentlibrary\documentlist.js:1646
Content:
<javascript>
/**
          * Thumbnail custom datacell formatter
          *
          * @method renderCellThumbnail
          * @param elCell {object}
          * @param oRecord {object}
          * @param oColumn {object}
          * @param oData {object|string}
          */
         return function DL_renderCellThumbnail(elCell, oRecord, oColumn, oData)
         {
            if (typeof scope.viewRenderers[scope.options.viewRendererName] === "object")
            {
               scope.viewRenderers[scope.options.viewRendererName].renderCellThumbnail(scope, elCell, oRecord, oColumn, oData);
            }
         };
</javascript>

And of course; an Jira Issue created IT Light Years ago, still no update: https://issues.alfresco.com/jira/browse/ALF-5418
Alfresco 3 seamed to be on right path with this ability: http://docs.alfresco.com/3.4/tasks/kb-icons-config.html but still no chance to get that running on Alfresco 5.

My baseground check may be accurate or it may be fuzzy, still how how can one get share to display a custom icon for a certain object type - lets say a custom folder inherited from cm:folder: xyz:folderZ in Alfresco 5?

P.s.: maybe this Trivial Task is just something no one ever needed or i just does not know how to search on the web, eitherway i hope very much on your help.

Alfresco Forum FTW!



2 REPLIES 2

asdfgh
Champ in-the-making
Champ in-the-making
It seems, that in Alfresco 5 the icons are hardcoded into the js files, see:
share/components/documentlibrary/documentlist-view-detailed.js
share/components/documentlibrary/documentlist-view-gallery-min.js
share/components/documentlibrary/documentlist-view-simple-min.js
share/components/documentlibrary/documentlist-view-table-min.js

they all contain the almost same code part:

    if (isContainer){
       …folder-64…
    else{
       …
    }

change it to:

    if (isContainer){
        if (record.node.type == "cm:folder"){
            …folder-64.png…
        else if(record.node.type == "xyz:folderZ"){
            …youricon-64.png…
    }else{
            …
    }

its basically the same as what is described in this post from 2011 : https://forums.alfresco.com/comment/71025#comment-71025 , but the record object changed, you have to check record.node.type instead of record.nodeType 




39steps
Champ in-the-making
Champ in-the-making

Is this still the only / best way to assign custom icons to a custom folder type?  

 

I need to assign status indicators as well so they are not a solution for me.