質問

I'm trying to get the profile picture of my users and display it in my liferay theme. So far I've been able to access the User object trough the velocity $user variable. The user model has a method called getPortraitUrl() which takes ThemeDisplay as a parameter. I've read in the liferay documentation that the themeDisplay object is available at runtime when working with themes, but I can't seem to make this work.

I've tried several different ways to get the themeDisplay object and none of them seem to work:

  • $theme
  • $themeDisplay
  • $request.get("theme-display")
  • $theme_display

... and several other methods that return nothing.

$user.getPortraitUrl($themeDisplay) is what I'm trying to achieve.

Any help would be greatly appreciated

役に立ちましたか?

解決

Be careful that the correct method is getPortraitURL(ThemeDisplay themeDisplay), URL is in uppercase.

Try this:

$user.getPortraitURL($themeDisplay)


You should also be able to use $themeDisplay.
Access Objects from Velocity is useful link for all liferay velocity variables.

他のヒント

The variable you need to use for ThemeDisplay is

$theme_display

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top