Overwrite Liferay Logo in Theme

Bradley Wood
Bradley Wood
Less Than a Minute Read

In every theme that I write I always put this snippet of code in my theme's init_custom.vm file.

## ---------- Logo ---------- ##
#if (($company.getLogoId() == 0) && $use_company_logo)
     #set ($site_logo = "${images_folder}/custom/logo.png")
     #set ($site_logo_height = 69) #set ($site_logo_width = 403)
#end 

Gist Link

What this snippet will do is display the site logo if one has been set, If a company logo has been set it will use that, if there isn't a company or site logo, then it uses the logo.jpg in the theme and displays it instead of the default liferay logo.

 

Please leave a comment below if this was helpful, thanks.

 

Bradley Wood
Woodbench Media
80W. Sierra Madre Blvd, #109
Sierra Madre, CA 91024

www.woodbenchmedia.com

Page Comments
It's worth noting that doing that ties the logo to the theme so it won't be possible to reuse the theme in several sites with different logos.
Adding the logo to the theme just overwrites the liferay default logo when a site logo hasn't been added through the control panel.
Hi Bradley,

Thanks for sharing. As i am not an expert on theme, will not be able to comment much on this. I am sure this will be useful indeed.

Ahamed Hasan
Author, Liferay Cookbook

The Technicalities of Static Sites

David Oliveira Montenegro
View Blog >

Customization is Dead! Long Live Customization!

David H Nebinger
View Blog >
customization banner image.png

Public Bug Bounty Program

David H Nebinger
View Blog >
bugbounty.png
Showing 1 to 3 of 3 entries.