留言板

Image from resources - Liferay DXP

thumbnail
Gustavo Oliveira,修改在7 年前。

Image from resources - Liferay DXP

Junior Member 帖子: 98 加入日期: 15-9-23 最近的帖子
Anyone found a way to reference an image from resources in a xhtml? Cant find a way to reference images from JSF resources, Im uploading images on Documents and Libraries to use.
thumbnail
Kyle Joseph Stiemann,修改在7 年前。

RE: Image from resources - Liferay DXP

Liferay Master 帖子: 760 加入日期: 13-1-14 最近的帖子
Hi Gustavo,
Please take a look at the portlet:resourceURL, h:graphicImage, and alloy:image examples. If you want to show an image from src/main/webapp/resources, you can use the pattern from these examples. To show an image from Documents and Media, I think you should be able to use DLUtil.getImagePreviewURL() in combination with h:graphicImage, alloy:image or a plain html img tag.
- Kyle
thumbnail
Gustavo Oliveira,修改在7 年前。

RE: Image from resources - Liferay DXP

Junior Member 帖子: 98 加入日期: 15-9-23 最近的帖子
Hey Kile, is it working for you? portlet:resourceURL, h:graphicImage, or alloy:image?

It worked on 6.2, but its now working on 7. Im using the last patched version.
thumbnail
Kyle Joseph Stiemann,修改在7 年前。

RE: Image from resources - Liferay DXP

Liferay Master 帖子: 760 加入日期: 13-1-14 最近的帖子
Hi Gustavo,
Please post the shortest, simplest code that reproduces your issue. Please also include the versions of Liferay, Liferay Faces, and any component suites that you are using. The showcase links that I provided are running on Liferay 7, so everything should be working correctly.

- Kyle