Search code examples
liferayliferay-6velocityfreemarker

Liferay Application Display Templates - available model attributes and APIs


I try to implement Application Display Templates for Media Gallery and Asset Publisher portlets. While I found rather good documentation on the general concepts of ADT and their usage (Liferay wiki, dev.liferay.com), I cannot find any documentation on the model attributes and APIs available in the templates.

E.g. For Media Gallery templates:

  • The gallery entries are available through "entries" attribute. Are there any other attributes available?
  • I can call methods on propsUtil, dlUtil or themeDisplay objects. What else is available in the template?

Question summary - What model attributes and APIs are available for:

  • All ADT templates?
  • Media Gallery templates?
  • Asset Publisher templates?
  • Is there any difference in the available objects between Freemarker and Velocity templates?

Solution

  • The documentation is hard to find, but for Freemarker there exists an utility, which displays the actual content of the context. It displays not only object names, but also their values (sort of debug info).

    See Dumping ADT+WCM Template Variables