Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Brett Conoly
NavItem code?
December 1, 2009 5:54 AM
Answer

Brett Conoly

Rank: Junior Member

Posts: 98

Join Date: July 19, 2007

Recent Posts

Hey All,
I'm looking for the class that contains the code to generate the NavItem's used by the themes. Would anyone mind pointing me in the right direction?
Thanks,
Brett
Jesse Paria
RE: NavItem code?
December 12, 2011 9:47 PM
Answer

Jesse Paria

Rank: Junior Member

Posts: 52

Join Date: March 4, 2011

Recent Posts

I am sure you foundit already but here it is
http://content.liferay.com/4.3/api/portal-service/com/liferay/portal/theme/NavItem.html
Venkat Koppavolu
RE: NavItem code?
December 13, 2011 5:13 AM
Answer

Venkat Koppavolu

Rank: Junior Member

Posts: 68

Join Date: July 25, 2010

Recent Posts

Theme is built on velocity variables and velocity variables are set in velocitycontext pool and these objects will change for each request.

Please check com.liferay.portal.velocity.VelocityVariables.java class how the objects are stored in velocityContext and this class will invoked for every reuqest.

VelocityVariables.java - line no: 444

List<NavItem> navItems = NavItem.fromLayouts(requestVars, layouts);
velocityContext.put("navItems", navItems);

navItems are prepared and set in the velocityContext.

If you want to store your own objects in velocitycontext and use with in the theme, then need to write hook and

In portal.properties
servlet.service.events.pre=your class implementation

Hope this will help you.

Thanks,
Venkat