Alfresco 5.2 Quick and Dirty Change icons

Posted on Sunday, February 5, 2017


I am running an Alfresco community edition locally and I want to change some of the default icons.

This is going to be a quick and dirty write up on how to change the icons. 





First the easy one





This icon

Log into alfresco share as an admin




Click on Admin Tools







From Applications simply click on Upload, choose a new picture and click apply







Done.


Next the harder ones.






Login Page





Replace this image.


I installed my Alfresco from the simple binary installer.  I places all my alfresco install at /10x13/apps/alfresco.

But wherever you are go to your base of your tomcat. 



  >  cd webapps/share/themes/lightTheme/images/




This is the one we want to replace.  It is 48x145 pixels.

This is an svg file and so I had to take a png file and convert it to an svg file.  I used this web site to do it.  http://image.online-convert.com/convert-to-svg [1]

I did not have much luck with converting my image.  I went from this



To this




Now there are some reasons why SVG is a vector based graphic so its hard to convert to. 

If you can get a good looking svg file here is what you should do to swap in yours.

I simply renamed it with a .BACK and put a new image in.  Then copied my image in


  >  sudo mv alfresco.svg alfresco.svg.BACK
  >  sudo cp ~/10x13_knowledge_48.svg alfresco.svg
  >  sudo chmod 744 alfresco.svg



To get the changes to take effect you need to restart tomcat.  Or in my case I just reboot the entire server.


  > sudo reboot





The alternative is to tweak a css file

First copy your file over.


  >  cd tomcat/webapps/share/themes/lightTheme/images
  >  sudo cp ~/10x13_knowledge_48.png .
  >  sudo chmod 744 10x13_knowledge_48.png




Go to this folder


  >  cd webapps/share/themes/lightTheme/


And open the presentation.css file for editing


  >  sudo vi presentation.css





At about line 1477 replace the .svg file with your own image.





Then reboot



  > sudo reboot


 



Wahoo it worked.

But, my image seems a little small to me so I am going to make a bigger version and see how it works.


My larger image is 80 x 328 pixels.  Aside from adding the image I also update presentation.css to the following


.theme-company-logo
{
   height: 80px;
   width: 325px;
   background: transparent url(images/10x13_knowledge_80.png) 50% 0 no-repeat;
   background-size: 328px 80px;
}


After another reboot here is the results.





But for me I do not like this part




How can I remove that part?




I did a little poking and found the file at  WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/guest/login.get.html.ftl

A little tweaking


  > sudo vi WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/guest/login.get.html.ftl





There are the two lines I need to delete.

(It may be a good idea to make a backup of the file before you tweak it.)


Then reboot


  > sudo reboot





And I got what I wanted.   J





Changing the footer


One other section I want to change is the footer section.




This section down here.


First to fix the text…


  > cd WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/footer




Edit footer.get.properties


  > sudo vi footer.get_en.properties


I updated mine to the following


label.copyright=10x13 © 2005-2017 All rights reserved.
label.copyright.enterprise=



Then I want to use another image at the bottom.  I am going to reuse the smaller 48 pixel image I already uploaded.  (10x13_knowledge_48.png)




Fix the footer script.


  >  cd webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/footer/
  > sudo vi footer.get.html.ftl




Update it to the following


<@markup id="css" >
   <#-- CSS Dependencies -->
   <@link href="${url.context}/res/modules/about-share.css" group="footer"/>
   <@link href="${url.context}/res/components/footer/footer.css" group="footer"/>
</@>

<@markup id="js">
   <@script src="${url.context}/res/modules/about-share.js" group="footer"/>
</@>

<@markup id="widgets">
   <@createWidgets/>
</@>

<@markup id="html">
   <@uniqueIdDiv>
      <#assign fc=config.scoped["Edition"]["footer"]>
      <div class="footer ${fc.getChildValue("css-class")!"footer-com"}">
         <span class="copyright">
            <a href="#" onclick="Alfresco.module.getAboutShareInstance().show(); return false;"><img src="${url.context}/res/themes/lightTheme/images/10x13_knowledge_48.png" alt="${fc.getChildValue("alt-text")!"Alfresco Community"}" border="0"/></a>
            <#if licenseHolder != "" && licenseHolder != "UNKNOWN">
               <span class="licenseHolder">${msg("label.licensedTo")} ${licenseHolder}</span><br>
            </#if>
            <span>${msg(fc.getChildValue("label")!"label.copyright")}</span>
         </span>
      </div>
   </@>
</@>


The highlighted is the only part I changed


Then reboot


  > sudo reboot








Wahoo that worked J






References


[1]  Online Convert
       Visited 2/2017


10 comments:

  1. Thank u very much, I want to ask you to set background to login page in alfresco

    ReplyDelete
    Replies
    1. Apply this changes on file presentation.css

      body.alfresco-guest
      {
      width: 325px;
      background: transparent url(images/filepath.png) 50% 0 no-repeat;
      background-size: 328px 80px;
      }

      .alfresco-guest .sticky-wrapper
      {
      background: transparent url(images/filepath.png) 50% 0 no-repeat;
      background-size: 328px 80px;
      }

      Delete
  2. Thank you very much, after reading many posts and technical documents from Alfresco and other communities, yours was very straight forward. Thumbs Up! and keep it up!

    ReplyDelete
  3. footer logo is not replaced how do i give path in footer.get.html.ftl
    the logo which i want is in themes folder

    ReplyDelete
  4. Very thanks for your contribution.

    ReplyDelete
  5. great! this tutorial helped me a lot, thanks! now how do u chance the favicon and title of the page?

    ReplyDelete