Overwrite Liferay Logo in Theme

Bradley Wood
Bradley Wood
Minder dan een minuut lezen

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

Paginareacties
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

Related Assets...

Geen resultaten gevonden

More Blog Entries...

Ben Turner
mei 15, 2026
David H Nebinger
mei 13, 2026