Introduction
Actually Alfresco documentation already has quite good article on how to customize footer. But it took me some time to understand it and implement my version of footer, because I am not very familiar with Surf. What I want to achieve is to remove Alfresco logo because it takes to much space, decrease footer size and add some useful information to it - like version of the deployed application, link to ticket system, version of Alfresco.
Let’s see how to achieve following result:
Unfortunately this approach doesn’t work for pages which are built using Aikau (like Search results page)
Extension
First thing to do is create /web-extension/site-data/extensions/mycmpny/efiles/footer/footer.xml and register extension there:
Footer
I want to have three column footer displaying:
copyright
Usually copyright is just a static text, like MyCmpny © 2013-2016, but then you need to change the end year every year, since footer implementation is in *.ftl** file let’s use some dynamic features. Like getting the current year: ${.now?string.yyyy}
and put it in span:
version
Ftl (maybe Spring, not sure) provides access to the maven version of the application with simple ${version}
and also the version of Alfresco which is being used ${alfresco.client.war.version}
:
link to ticket system
It would be just a link with text, but let’s add multilanguage support. Add file /web-extension/site-webscripts/mycmpny/efiles/footer/footer.get_en.properties with label.snow=Support is <a href="http://mySupportlink.com"> here
. To get the proper message ftl has msg()
function which is used like this:
Put everything together in /web-extension/site-webscripts/mycmpny/efiles/footer/footer.get.html.ftl:
and style with some css in src/main/resources/META-INF/components/footer/my-footer.css: