Liferay is a Gartner Magic Quadrant Leader for the Sixth Year! Find out why

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Daniel Wilmes
Velocity
July 25, 2011 7:15 AM
Answer

Daniel Wilmes

Rank: Regular Member

Posts: 164

Join Date: May 23, 2011

Recent Posts

I am currently setting some variables in the /_diff/templates/init_custom.vm file and want to print out the the variables to the screen of tomcat. Can this be done? Here is the code I would be writing:

#if(!$permissionChecker.isOmniadmin())
#set ($user_roles = $user.getRoles())
#set ($show_my_places = false)
#foreach($role in $user_roles)
#if (!$role.getTitle($locale).equals("THE USER"))
#set($css_class="disable-add-more-control $css_class")
#end
#set($css_class="disable-my-places-control $css_class")
#set($css_class="disable-page-layout-control $css_class")
#set($css_class="disable-site-control $css_class")
#set($css_class="disable-settings-control $css_class")
#set($css_class="disable-manage-page-control $css_class")

#end
#end

I would like to print out the roles when looping. Can this be done.

Thanks Daniel
Daniel Wilmes
RE: Velocity
July 26, 2011 4:41 AM
Answer

Daniel Wilmes

Rank: Regular Member

Posts: 164

Join Date: May 23, 2011

Recent Posts

I had to create a custom hook from the SDK. This has the method to create a hook and call in from your velocity page.

How to create a custom hook for velocity liferay