Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Navitem class issue in liferay 6.1 vs Liferay 7
Hi all,In Liferay 6.1 I am using the below code for navigation purpose based on ancestors from Layout the navigation works
Layout currentLayout = ancestors.get(levelMax);
NavItem navItem = NavItem.fromLayout(vars, currentLayout);
But in Liferay 7 the above method has been changed as shown belowList<NavItem> navItem= NavItem.fromLayouts(httpServletRequest, themeDisplay, (Map<String,Object>)contextObjects);
The above method is list type so I am unable to send the corresponding Navitem and the currentLayout object in that method. I want to use currentLayout in fromLayouts() method. So can anyone send me the solution for this?
Layout currentLayout = ancestors.get(levelMax);
NavItem navItem = NavItem.fromLayout(vars, currentLayout);
But in Liferay 7 the above method has been changed as shown belowList<NavItem> navItem= NavItem.fromLayouts(httpServletRequest, themeDisplay, (Map<String,Object>)contextObjects);
The above method is list type so I am unable to send the corresponding Navitem and the currentLayout object in that method. I want to use currentLayout in fromLayouts() method. So can anyone send me the solution for this?
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™