Gustav Novotný Vor 6 Jahren Hey, that's perfect hint! Thank you, Eduardo. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Santiago Pérez de la Cámara Vor 6 Jahren Great post! Thanks,Santiago Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Mirto Silvio Busico Vor 6 Jahren 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 Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Eduardo P. Garcia Mirto Silvio Busico Vor 6 Jahren 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 Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Eduardo P. Garcia Mirto Silvio Busico Vor 6 Jahren 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 Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Petr Bodnár Vor 6 Jahren 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? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Orin Fink Petr Bodnár Vor 6 Jahren 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. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Petr Bodnár Orin Fink Vor 6 Jahren OK, sounds reasonable, thanks for your sharing Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Eduardo P. Garcia Petr Bodnár Vor 6 Jahren 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. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Orin Fink Petr Bodnár Vor 6 Jahren 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. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Petr Bodnár Orin Fink Vor 6 Jahren OK, sounds reasonable, thanks for your sharing Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Petr Bodnár Orin Fink Vor 6 Jahren OK, sounds reasonable, thanks for your sharing Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Eduardo P. Garcia Petr Bodnár Vor 6 Jahren 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. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Sandro Zacchino Vor 6 Jahren 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? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Sandro Zacchino Sandro Zacchino Vor 6 Jahren 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 Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Santiago Pérez de la Cámara Sandro Zacchino Vor 6 Jahren 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! Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Sandro Zacchino Santiago Pérez de la Cámara Vor 6 Jahren 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 Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Sandro Zacchino Sandro Zacchino Vor 6 Jahren 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 Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Santiago Pérez de la Cámara Sandro Zacchino Vor 6 Jahren 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! Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Sandro Zacchino Santiago Pérez de la Cámara Vor 6 Jahren 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 Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Santiago Pérez de la Cámara Sandro Zacchino Vor 6 Jahren 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! Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Sandro Zacchino Santiago Pérez de la Cámara Vor 6 Jahren 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 Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Sandro Zacchino Santiago Pérez de la Cámara Vor 6 Jahren 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 Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Heiko Ottenbacher Vor 5 Jahren 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! Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Joseph Toman Vor 5 Jahren 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. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen