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
Liferay 7.2 - How to add Navigation Menus programmatically?
Hi,
I have been adding groups and layouts with the GroupLocalServiceUtil and LayoutLocalServiceUtil classes respectively. I was wondering if there is some way to add Navigation Menus programmatically with some Util class like the previous examples.
How can I add a Navigation Menu programmatically?
I have been adding groups and layouts with the GroupLocalServiceUtil and LayoutLocalServiceUtil classes respectively. I was wondering if there is some way to add Navigation Menus programmatically with some Util class like the previous examples.
How can I add a Navigation Menu programmatically?
Hi ,
You can try below Utilities
You can try below Utilities
SiteNavigationMenuLocalServiceUtil
SiteNavigationMenuItemLocalServiceUtil
Hi Mohammed,
Thanks a lot for the answer. This looks indeed the solution, but I can't find those classes anywhere. Using any of those classes on my portlet result on a "cannot be resolved as a type". Are those classes from a certain package that I need to import?
Thanks a lot for the answer. This looks indeed the solution, but I can't find those classes anywhere. Using any of those classes on my portlet result on a "cannot be resolved as a type". Are those classes from a certain package that I need to import?
You can use this gradle dependency compile group: 'com.liferay', name: 'com.liferay.site.navigation.api', version: 'as per your target'
That's it! Thank you very much!
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™