Gustav Novotný Hace 6 años Hey, that's perfect hint! Thank you, Eduardo. Por favor identifíquese para votar. Contestar como... Cancelar
Santiago Pérez de la Cámara Hace 6 años Great post! Thanks,Santiago Por favor identifíquese para votar. Contestar como... Cancelar
Mirto Silvio Busico Hace 6 años 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 Por favor identifíquese para votar. Contestar como... Cancelar Eduardo P. Garcia Mirto Silvio Busico Hace 6 años 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 Por favor identifíquese para votar. Contestar como... Cancelar
Eduardo P. Garcia Mirto Silvio Busico Hace 6 años 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 Por favor identifíquese para votar. Contestar como... Cancelar
Petr Bodnár Hace 6 años 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? Por favor identifíquese para votar. Contestar como... Cancelar Orin Fink Petr Bodnár Hace 6 años 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. Por favor identifíquese para votar. Contestar como... Cancelar Petr Bodnár Orin Fink Hace 6 años OK, sounds reasonable, thanks for your sharing Por favor identifíquese para votar. Contestar como... Cancelar Eduardo P. Garcia Petr Bodnár Hace 6 años 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. Por favor identifíquese para votar. Contestar como... Cancelar
Orin Fink Petr Bodnár Hace 6 años 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. Por favor identifíquese para votar. Contestar como... Cancelar Petr Bodnár Orin Fink Hace 6 años OK, sounds reasonable, thanks for your sharing Por favor identifíquese para votar. Contestar como... Cancelar
Petr Bodnár Orin Fink Hace 6 años OK, sounds reasonable, thanks for your sharing Por favor identifíquese para votar. Contestar como... Cancelar
Eduardo P. Garcia Petr Bodnár Hace 6 años 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. Por favor identifíquese para votar. Contestar como... Cancelar
Sandro Zacchino Hace 6 años 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? Por favor identifíquese para votar. Contestar como... Cancelar Sandro Zacchino Sandro Zacchino Hace 6 años 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 Por favor identifíquese para votar. Contestar como... Cancelar Santiago Pérez de la Cámara Sandro Zacchino Hace 6 años 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! Por favor identifíquese para votar. Contestar como... Cancelar Sandro Zacchino Santiago Pérez de la Cámara Hace 6 años 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 Por favor identifíquese para votar. Contestar como... Cancelar
Sandro Zacchino Sandro Zacchino Hace 6 años 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 Por favor identifíquese para votar. Contestar como... Cancelar Santiago Pérez de la Cámara Sandro Zacchino Hace 6 años 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! Por favor identifíquese para votar. Contestar como... Cancelar Sandro Zacchino Santiago Pérez de la Cámara Hace 6 años 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 Por favor identifíquese para votar. Contestar como... Cancelar
Santiago Pérez de la Cámara Sandro Zacchino Hace 6 años 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! Por favor identifíquese para votar. Contestar como... Cancelar Sandro Zacchino Santiago Pérez de la Cámara Hace 6 años 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 Por favor identifíquese para votar. Contestar como... Cancelar
Sandro Zacchino Santiago Pérez de la Cámara Hace 6 años 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 Por favor identifíquese para votar. Contestar como... Cancelar
Heiko Ottenbacher Hace 5 años 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! Por favor identifíquese para votar. Contestar como... Cancelar
Joseph Toman Hace 5 años 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. Por favor identifíquese para votar. Contestar como... Cancelar