2016-09-21 2 views
0

동적 데이터리스트의 속도로 맞춤 템플릿을 만들고 있는데 이미지를보고 싶습니다. 이미지를로드하려면 어떻게해야합니까?Liferay 및 동적 데이터리스트 : 이미지를 얻는 방법?

#set ($DDLRecordService = $serviceLocator.findService("com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService")) 
#set ($records = $DDLRecordService.getRecords($mathTool.toNumber($reserved_record_set_id))) 
#foreach ($record in $records) 
    #set($fields = $record.getFields()) 
    #set($URL = $fields.get("URL").getValue()) 
    #set($Link = $fields.get("Linktitle").getValue()) 
    #set($Preview = $fields.get("Vorschaubild").getValue()) ##the image is here 
    $URL 
    $Link 
    $Preview 
#end 

은 $ 프리뷰 출력은 다음과 같습니다 :

코드는 점이다 { "의 groupId": "0000000", "UUID": "ccdaccec-00a0-4284-a000-589be48 99281", " 버전 ":"1. 0 "}

의견이 있으십니까?

+0

$ fields.get ("Vorschaubild"). getValue()는 이미지의 URL을 반환합니까? –

+0

아니요, 객체의 속성을 반환합니다. { "groupId": "0000000", "uuid": "ccdaccec-00a0-4284-a000-589be4899281", "version": "1.0"} –

+0

'imageId'가 있습니까? 그 안에? –

답변

0

UUID_HERE를 실제 UUID로 바꾸면 작동합니다.

<a href='${themeDisplay.getPortalURL()}/c/document_library/get_file?uuid=UUID_HERE&groupId=${themeDisplay.getScopeGroupId()}'>MyFile OR Image</a> 
관련 문제