0

How can i create a template with velocity or Freemarker for DDL in liferay ? I have a DLL with some data, i would display it not as a table but as a menu beacouse data is defined as [link,text]. i tried this code: <#assign records = ddlDisplayTemplateHelper.getRecords(reserved_record_set_id)> <#if records?has_content> <#list records as cur_record> ll </#list> </#if> in ddl there are 4 records, so this code would return ll ll ll ll , but it returns : Expression ddlDisplayTemplateHelper is undefined on line 1, column 20 in 20155#20195#21230.

why? can anyone help me?

4
  • I guess it was clear, but to be on the safe side: The error message says that there's no variable called ddlDisplayTemplateHelper (or its value is null), so for some reason Liferay doesn't expose that tool to the template. Commented Apr 22, 2017 at 12:43
  • Yes, but how can i fix it? Commented Apr 23, 2017 at 22:35
  • What is that ddlDisplayTemplateHelper, I am unable to find any class with that name in Liferay 6.2. By the way what version of Liferay are you using? Commented Apr 25, 2017 at 6:35
  • May liferay versione is 6.2 ... I use That class because i find It in a forum but it never worked Commented Apr 25, 2017 at 8:46

1 Answer 1

0

Using velocity, you can try something like this :

#set($records = $ddlDisplayTemplateHelper.getRecords(reserved_record_set_id))
#foreach($record in $records)
$record
#end
Sign up to request clarification or add additional context in comments.

5 Comments

it doesn't show any error message but it doesn't diplay any record
If you tried it using velocity, you have to add ddlDisplayTemplateHelper to the velocity context.
how can i do it?
context.put("ddlDisplayTemplateHelper ", "<DdlDisplayTemplateHelper object>"); have a look at this tutorial for velocity : javaworld.com/article/2075966/core-java/…
is there an easier way to display data from a ddl?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.