Pages

Tuesday, 9 April 2013

Access image from liferay theme


If you want to access any images in liferay from theme,

you can follow below very simple steps:

1) Define the taglib in your portlet jsp file
<%@taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %> 
2)Define the liferay tag like
<liferay-theme:defineObjects /> 
3)After doing this we would have themeDisplay object available in portlet jsp file 
so you can use
<img src="${themeDisplay.getPathThemeImages}/your_Image_folder/image.png" /> 
So that's it ... 

No comments:

Post a Comment