cancel
Showing results for 
Search instead for 
Did you mean: 

Can I change site logo

neozone
Champ in-the-making
Champ in-the-making
I create new site in Alfresco share and I see it has logo look like globe. Can I change it?
3 REPLIES 3

gronfelt
Champ in-the-making
Champ in-the-making
It's determined in the css file <alfresco dir>/tomcat/webapps/share/components/dashlets/my-sites.css. The picture used by default is <alfresco dir>/tomcat/webapps/share/components/images/site-24.png.

You could either edit the css file or overwrite the picture file.

neozone
Champ in-the-making
Champ in-the-making
If I have many sites. Can I change logo for each sites?

gronfelt
Champ in-the-making
Champ in-the-making
Do you mean that you want to have individual logos for each site?

The div objects containing each site in the list is created by a .js-file, tomcat/webapps/share/components/dashlets/my-sites.js:

/**
          * Name & description custom datacell formatter
          */
         var renderCellName = function MS_oR_renderCellName(elCell, oRecord, oColumn, oData)
         {
            var siteId = oRecord.getData("shortName"),
               siteTitle = oRecord.getData("title"),
               siteDescription = oRecord.getData("description");

            var desc = '<div class="site-title"><a href="' + Alfresco.constants.URL_PAGECONTEXT + 'site/' + siteId + '/dashboard" class="theme-color-1">' + $html(siteTitle) + '</a></div>';
            desc += '<div class="site-description">' + $html(siteDescription) + '</div>';

            elCell.innerHTML = desc;
         };

What you could do is duplicate the bold part and use a conditonal expression, like this:

/**
          * Name & description custom datacell formatter
          */
         var renderCellName = function MS_oR_renderCellName(elCell, oRecord, oColumn, oData)
         {
            var siteId = oRecord.getData("shortName"),
               siteTitle = oRecord.getData("title"),
               siteDescription = oRecord.getData("description");

            if (siteId == "yoursite1")
            {
                  var desc = '<div class="site-title-1"><a href="' + Alfresco.constants.URL_PAGECONTEXT + 'site/' + siteId + '/dashboard" class="theme-color-1">' + $html(siteTitle) + '</a></div>';
            } else
            {
                 var desc = '<div class="site-title"><a href="' + Alfresco.constants.URL_PAGECONTEXT + 'site/' + siteId + '/dashboard" class="theme-color-1">' + $html(siteTitle) + '</a></div>';
            }

            desc += '<div class="site-description">' + $html(siteDescription) + '</div>';

            elCell.innerHTML = desc;
         };

However, it's not quite as simple as that, because it's not the actual my-sites.js file that's called, but a compacted version named my-sites-min.js. So that's the file you need to overwrite. I guess that there's some kind of mechanism to create the compacted min-version, but I don't know how that works.

But in the meantime it would be ok to just edit the my-sites.js file and copy it to my-sites-min.js or edit the my-sites-min.js file directly, whichever you prefer.