Gustav Novotný Il y a 6 années Hey, that's perfect hint! Thank you, Eduardo. Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Santiago Pérez de la Cámara Il y a 6 années Great post! Thanks,Santiago Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Mirto Silvio Busico Il y a 6 années Question: where can I find the accepted definitions for @liferay_frontend?I mean other than vertical-card and vertical-card-footer what are the other options?Where can I find documentation about this?Thanks Veuillez vous identifier pour voter. Répondre en tant que ... Annuler Eduardo P. Garcia Mirto Silvio Busico Il y a 6 années Hi Mirto,You can find the javadocs for the frontend taglibs here: https://docs.liferay.com/ce/apps/foundation/latest/javadocs/com/liferay/frontend/taglib/.And the TLD is here:https://github.com/liferay/liferay-portal/blob/7.0.x/modules/apps/foundation/frontend-taglib/frontend-taglib/src/main/resources/META-INF/liferay-frontend.tld Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Eduardo P. Garcia Mirto Silvio Busico Il y a 6 années Hi Mirto,You can find the javadocs for the frontend taglibs here: https://docs.liferay.com/ce/apps/foundation/latest/javadocs/com/liferay/frontend/taglib/.And the TLD is here:https://github.com/liferay/liferay-portal/blob/7.0.x/modules/apps/foundation/frontend-taglib/frontend-taglib/src/main/resources/META-INF/liferay-frontend.tld Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Petr Bodnár Il y a 6 années Hi, thanks for this great article. I'm missing just two important things in it:1) It should have been stated clearly *right in the first paragraph* that this article is not quite applicable to older versions of Liferay, or is it? We haven't found an easy way to do something similar prior to Liferay 7.2) What if one would need to *link to the details of the rendered items* from inside the content rendered by the WC template. We've got the item's page URL available in the AP template, but how can we read it in the called WC template? Veuillez vous identifier pour voter. Répondre en tant que ... Annuler Orin Fink Petr Bodnár Il y a 6 années For the link to detail, you _could_ put a token (like {{link-to-detail}} ) in the web content article template and then do a replace of that token with the link from the ADT code.The ADT (and the asset entry) give you a little more power to build the detail link so that worked better for us in our case while using a similar approach with velocity in 6.2. Veuillez vous identifier pour voter. Répondre en tant que ... Annuler Petr Bodnár Orin Fink Il y a 6 années OK, sounds reasonable, thanks for your sharing Veuillez vous identifier pour voter. Répondre en tant que ... Annuler Eduardo P. Garcia Petr Bodnár Il y a 6 années Hi Petr,1) Certainly, the article contains code examples that are directly applicable only to Liferay 7. But you can achieve this on 6.2, too. In that version, the journal-article taglib was located in the liferay-ui namespace. Thus, you'd have to use liferay_ui["journal-article"] instead of "liferay_journal["journal-article"]. The card taglibs are new in Liferay 7, but you can use any bootstrap similar components instead. (http://getbootstrap.com/2.3.2/components.html).2) You should be able to obtain the AssetRenderer from within the WC template, and obtain the URLs with it. Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Orin Fink Petr Bodnár Il y a 6 années For the link to detail, you _could_ put a token (like {{link-to-detail}} ) in the web content article template and then do a replace of that token with the link from the ADT code.The ADT (and the asset entry) give you a little more power to build the detail link so that worked better for us in our case while using a similar approach with velocity in 6.2. Veuillez vous identifier pour voter. Répondre en tant que ... Annuler Petr Bodnár Orin Fink Il y a 6 années OK, sounds reasonable, thanks for your sharing Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Petr Bodnár Orin Fink Il y a 6 années OK, sounds reasonable, thanks for your sharing Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Eduardo P. Garcia Petr Bodnár Il y a 6 années Hi Petr,1) Certainly, the article contains code examples that are directly applicable only to Liferay 7. But you can achieve this on 6.2, too. In that version, the journal-article taglib was located in the liferay-ui namespace. Thus, you'd have to use liferay_ui["journal-article"] instead of "liferay_journal["journal-article"]. The card taglibs are new in Liferay 7, but you can use any bootstrap similar components instead. (http://getbootstrap.com/2.3.2/components.html).2) You should be able to obtain the AssetRenderer from within the WC template, and obtain the URLs with it. Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Sandro Zacchino Il y a 6 années Hi, great article. I'm wondering if its possible to set some sort of context variable in the red boxed adt (the one for assetpublisher) and use it in the web content model (the green boxed one). Using an asset publisher it's common to build a viewUrl from asset like this:viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, assetRenderer, entry, true)However I don't know how to render this information in the web content model. There is some mechanism to pass information between these two ftls? Veuillez vous identifier pour voter. Répondre en tant que ... Annuler Sandro Zacchino Sandro Zacchino Il y a 6 années I solved using the following steps:1) in the asset publisher's ADT I've used:<#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext() /><#if entries?has_content> <#list entries as entry> <#assign assetRenderer = entry.getAssetRenderer() journalArticle = assetRenderer.getAssetObject() viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, assetRenderer, entry, !stringUtil.equals(assetLinkBehavior, "showFullContent")) temp = serviceContext.setAttribute("my_view_url", viewURL) /> <@liferay_journal["journal-article"] articleId=journalArticle.getArticleId() ddmTemplateKey="000000" groupId=journalArticle.getGroupId() /> </#list></#if>2) in web content template I've used:...<#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext() viewURL = serviceContext.getAttribute("my_view_url") />${viewURL}...Do you think it's a good way to pass information between the two templates?Thanks Veuillez vous identifier pour voter. Répondre en tant que ... Annuler Santiago Pérez de la Cámara Sandro Zacchino Il y a 6 années Hi Sandro:I'm trying to reproduce your example but I get an error in the structure template when accessing to the serviceContext's attribute:The following has evaluated to null or missing:==> serviceContext.getAttribute("my_view_url") [in template "20116#20152#43209" at line 6, column 22]There are no errors when processing the ADT, just in the structure template. What is it missing?Thank you! Veuillez vous identifier pour voter. Répondre en tant que ... Annuler Sandro Zacchino Santiago Pérez de la Cámara Il y a 6 années Hi Santiago,the line you reported should be put in the model template, but you have to put a temp = serviceContext.setAttribute("my_view_url", "some value") in the assetpublisher template, processed before the model one, otherwise the attribute will not be found in the model template Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Sandro Zacchino Sandro Zacchino Il y a 6 années I solved using the following steps:1) in the asset publisher's ADT I've used:<#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext() /><#if entries?has_content> <#list entries as entry> <#assign assetRenderer = entry.getAssetRenderer() journalArticle = assetRenderer.getAssetObject() viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, assetRenderer, entry, !stringUtil.equals(assetLinkBehavior, "showFullContent")) temp = serviceContext.setAttribute("my_view_url", viewURL) /> <@liferay_journal["journal-article"] articleId=journalArticle.getArticleId() ddmTemplateKey="000000" groupId=journalArticle.getGroupId() /> </#list></#if>2) in web content template I've used:...<#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext() viewURL = serviceContext.getAttribute("my_view_url") />${viewURL}...Do you think it's a good way to pass information between the two templates?Thanks Veuillez vous identifier pour voter. Répondre en tant que ... Annuler Santiago Pérez de la Cámara Sandro Zacchino Il y a 6 années Hi Sandro:I'm trying to reproduce your example but I get an error in the structure template when accessing to the serviceContext's attribute:The following has evaluated to null or missing:==> serviceContext.getAttribute("my_view_url") [in template "20116#20152#43209" at line 6, column 22]There are no errors when processing the ADT, just in the structure template. What is it missing?Thank you! Veuillez vous identifier pour voter. Répondre en tant que ... Annuler Sandro Zacchino Santiago Pérez de la Cámara Il y a 6 années Hi Santiago,the line you reported should be put in the model template, but you have to put a temp = serviceContext.setAttribute("my_view_url", "some value") in the assetpublisher template, processed before the model one, otherwise the attribute will not be found in the model template Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Santiago Pérez de la Cámara Sandro Zacchino Il y a 6 années Hi Sandro:I'm trying to reproduce your example but I get an error in the structure template when accessing to the serviceContext's attribute:The following has evaluated to null or missing:==> serviceContext.getAttribute("my_view_url") [in template "20116#20152#43209" at line 6, column 22]There are no errors when processing the ADT, just in the structure template. What is it missing?Thank you! Veuillez vous identifier pour voter. Répondre en tant que ... Annuler Sandro Zacchino Santiago Pérez de la Cámara Il y a 6 années Hi Santiago,the line you reported should be put in the model template, but you have to put a temp = serviceContext.setAttribute("my_view_url", "some value") in the assetpublisher template, processed before the model one, otherwise the attribute will not be found in the model template Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Sandro Zacchino Santiago Pérez de la Cámara Il y a 6 années Hi Santiago,the line you reported should be put in the model template, but you have to put a temp = serviceContext.setAttribute("my_view_url", "some value") in the assetpublisher template, processed before the model one, otherwise the attribute will not be found in the model template Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Heiko Ottenbacher Il y a 5 années Hello.. Thanks for this great article. But I have one question: What if I want to get the html code that tag creates itself? Is there a way to obtain the html code fragment of the asset rendered by its template and store it - for example in a variable?Thanks alot in advance! Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Joseph Toman Il y a 5 années This is an interesting idea. The only thing I'm not thrilled about is that hardcoded DDMTemplateKey . If you are collaborating with someone, or need to move it from a dev system to production it's certainly going to change. I wonder, can a web content template tell what portlet it is being rendered in? If so then it would be better to code one template with<#if isAssetPublisher > ... <#else> <#-- is WCD --> ... </#if>sort of logic. Veuillez vous identifier pour voter. Répondre en tant que ... Annuler