Overwrite Liferay Logo in Theme

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

博客
Thanks Bradley; nice tip to know for future!
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