Foren

ADT + Freemarker

thumbnail
Andew Jardine, geändert vor 9 Jahren.

ADT + Freemarker

Liferay Legend Beiträge: 2416 Beitrittsdatum: 22.12.10 Neueste Beiträge
Hey Guys,

Stuck on something. I'm just starting to work with Freemarker -- traditionally I have worked more with Velocity. I've got a portlet and the ADT piece is working great. Now I am just trying to figure out how to get some of the template flushed out. I managed to include the portlet taglib and create a portlet url. Now what I am doing is trying to access the renderParameters.

I used the toolbar on the left so tha tin my template I have a ${renderRequest} object. Now, inside there I can see auto-complete options so I have chosen ... getParameter("myVar") so that my final markup is --


<div>${renderRequest.getParameter("myVar")}</div> 


I know. Very exciting emoticon. But when I try to render this template I am getting an error --


Expression renderRequest.parameter is undefined on line 24, column 3 in 12139#12171#106002.
1&lt;#-- 
2Application display templates can be used to modify the look of a 
3specific application. 
...
...


Which I don't understand because the UI gave me both the variable and the auto-complete.

What am I missing here?
thumbnail
Krzysztof Gołębiowski, geändert vor 9 Jahren.

RE: ADT + Freemarker

Liferay Master Beiträge: 549 Beitrittsdatum: 25.06.11 Neueste Beiträge
Hello Andrew,
I've been using the following snippet to get parameters from renderRequest:
&lt;#assign currentCategoryId = paramUtil.getLong(request, "categoryId") /&gt;

Regards,
KG
thumbnail
Andew Jardine, geändert vor 9 Jahren.

RE: ADT + Freemarker

Liferay Legend Beiträge: 2416 Beitrittsdatum: 22.12.10 Neueste Beiträge
Hi Krzysztof,

Thanks for the tip -- I'll give it a shot later and let you know if I have any luck. Do you have any references that you use to get through these situations? Or is it just basically crawling through LR source and the Freemarker guide?
thumbnail
Krzysztof Gołębiowski, geändert vor 9 Jahren.

RE: ADT + Freemarker

Liferay Master Beiträge: 549 Beitrittsdatum: 25.06.11 Neueste Beiträge
Hmm, there is one very usefull script, published by James Falkner - https://www.liferay.com/web/james.falkner/blog/-/blogs/dumping-adt-wcm-template-variables. It saved me a lot of time emoticon If you still have problems, everything what is left is debugging Liferay's code :/

Regards,
KG
thumbnail
Andew Jardine, geändert vor 9 Jahren.

RE: ADT + Freemarker

Liferay Legend Beiträge: 2416 Beitrittsdatum: 22.12.10 Neueste Beiträge
Awesome Krzysztof! I actually remembered reading that post but when I tried to find it again I couldn't. Bookmarked this time though emoticon