Accessing the image from theme

Some times it may requires to access the image from the theme. So here we go,

view.jsp

<%@taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
<liferay-theme:defineObjects/>

<img src="${themeDisplay.getPathThemeImages()}/info.png" />

Here themeDisplay.getPathThemeImages() gets the default image path as (<your theme name> /images)

If you create a custom folder in images folder then you have to give folder name after the themeDisplay.getPathThemeImages().

Comments

Popular posts from this blog

Theme display in javascript

How to know which liferay version we are using

Viewing the SQL Query in liferay : debugging the SQL Query in Hibernate