留言板
Image gallery
hi
how to get image from liferay image gallery using image name?
how to get image from liferay image gallery using image name?
Hi Vivek,
During one of our project execution, we had same requirement and I developed one method.
In this method, you have to pass the object of IGFolder - which is the folder contains your image.
I hope this may helps you.
Let me know if you have any query.
During one of our project execution, we had same requirement and I developed one method.
private IGImage getImage(IGFolder igFolder, String imageName, ThemeDisplay themeDisplay) {
IGImage igImage = null;
if (igFolder != null) {
try {
List<igimage> imageList = IGImageLocalServiceUtil.getImages(themeDisplay.getScopeGroupId(), igFolder.getFolderId());
for (IGImage igImg : imageList) {
if (imageName.equalsIgnoreCase(igImg.getName())) {
igImage = igImg;
break;
}
}
} catch (Exception e) {
LOG.warn(e.getMessage());
}
}
return igImage;
}</igimage>
In this method, you have to pass the object of IGFolder - which is the folder contains your image.
I hope this may helps you.
Let me know if you have any query.