HelmutSteiner
HelmutSteiner

Reputation: 99

Invoking Liferay's themeDisplay object within freemarker template

I need to access the themeDisplay object in a customized freemarker template.

I tried to do it like this:

${themeDisplay.getLanguageId()} 

But i get the following error message:

Expression themeDisplay is undefined on line 208, column 18

I also tried to add this two lines in my portal-ext.properties but without success:

freemarker.engine.restricted.classes=
freemarker.engine.restricted.variables=

Is there a successful approach for doing this ?

Thank you very much.

Upvotes: 0

Views: 3553

Answers (1)

Harvey Tamayo
Harvey Tamayo

Reputation: 21

You can get a version of theme display from request, just like this: <#assign themeDisplay = request['theme-display'] />.

But be carefull, this is only a lite version, so you can get the plid value: themeDisplay['plid'], but you can't get the layout object (themeDisplay.getLayout()).

All depends of what you want to do with the object. Regards

Note: this is only in 6.2 CE, it seems that in Liferay 7 the themeDisplay is complete and an implicit variable.

Upvotes: 1

Related Questions