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
Embed secondary navigation menu in Liferay theme
Hi, there!
I'm currently developing a new theme in Liferay 7.1.1-ga2. In this theme I need to show two navigation menus - primary and secondary. I already created these menus in my admin and now I'm trying to embed them in my theme. Unfortunatelly, I cannot set the correct menu type for the secondary menu. Nomatter what preferences I'm trying to pass I always see the primary navigation menu. The code that I use is the following:
<#assign preferencesMap = {<br>
"displayDepth": "1",<br>
"selectSiteNavigationMenuType": "2" // ->
this is the matching type identifier<br> }<br> /><br>
<@liferay.navigation_menu<br>
default_preferences=freeMarkerPortletPreferences.getPreferences(preferencesMap)<br>
instance_id="secondary_navigation"<br> />
Am I doing something wrong or it is impossible to achieve what I need?
Any help will be appreciated!
Thanks in advance,
Eli
Hey Eli,
Instead of"selectSiteNavigationMenuType": "2"
try using "siteNavigationMenuType": "2"
. There is a quirk (feature or bug) with embedded portlets where once
it's deployed the default_preferences
can't be updated again on subsequent deploys. The only way to make
changes apply is to delete the embedded portlet's preferences from the
database. The way I would test changes to default_preferences
is to change the instance_id
every time I make a change and deploy.
Hi, Patrick!
Thank you so much for you quick answer! Your solution worked great
for me Following your advices I changed
preference
"selectSiteNavigationMenu"
to
"siteNavigationMenuType"
as now I pass a
different instance_id
each time on deployment. Obviously
this the correct approach.
Thank you once again!
Greetings,
Eli
Powered by Liferay™