How to obtain the languageid in a Liferay theme with velocity

試著忘記壹切 提交于 2019-12-07 14:11:53

问题


For the current theme im creating there are multiple images that require to change based on the current language.

For example if the user is visiting the page in english we would load image_languageid.jpg

How can you replace languageid with the actual id of the language in velocity & liferay?

Is this a good technique or is there a nicer one?


回答1:


Try adding this line in init_custom.vm or portal_normal.vm

#set ($language_id = $themeDisplay.getLanguageId())


来源:https://stackoverflow.com/questions/8254603/how-to-obtain-the-languageid-in-a-liferay-theme-with-velocity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!