Fórum

Asset Display

Edward A, modificado 6 Anos atrás.

Asset Display

New Member Postagens: 23 Data de Entrada: 16/06/17 Postagens Recentes
Hi!

I need some help with understanding how to use the asset display tag. I have seen some ADTs that use it, mainly the ones that come with Porygon, but I don't know yet how to include it in a view created with JSP. I just need an example, and if you could explain it, that would be great.


Any help will be greatly appreciated.
Edward A, modificado 6 Anos atrás.

RE: Asset Display (Resposta)

New Member Postagens: 23 Data de Entrada: 16/06/17 Postagens Recentes
Ok, I was able to come up with the answer. Hopefully this example using JournalArticle will be helpful to the community.


<%
//Where "entry" is of type JournalArticle.
AssetEntry assetEntry = AssetEntryLocalServiceUtil.fetchEntry(JournalArticle.class.getName(), entry.getResourcePrimKey());
%>
<aui:col md="12">
    <liferay-ui:asset-display assetentry="<%=assetEntry %>" template="full_content"></liferay-ui:asset-display>
</aui:col>


Please consider that I am no expert in Liferay, and there might be a better approach to doing this.