简体   繁体   中英

Liferay 7.2 print custom menu

I have Liferay 7.2 I create a custom theme.

I created a custom navigation menu "link-utili" in back-end

I have main navigation but i need a secondary navigation before the footer but i have not any solution.

I tried:

<#assign preferencesMap = {"displayDepth": "1", "portletSetupPortletDecoratorId": "barebone", "siteNavigationMenuType": "2"} />

            <@liferay.navigation_menu
                default_preferences=freeMarkerPortletPreferences.getPreferences(preferencesMap)
                instance_id="link-utili"
            />

how i cand do that?

If you have marked your custom Site-NavigationMenu as "Seconday Navigation" (see the ... context-menu of your menu entry), you could use the following snippet in your theme to print the secondary navigation (as an example, some settings can be adjusted to fit your needs):

<#assign secondaryNavigationPreferencesMap = {
        "displayStyle": "ddmTemplate_NAVBAR-BLANK-JUSTIFIED-FTL", 
        "portletSetupPortletDecoratorId": "barebone", 
        "rootLayoutType": "relative", 
        "siteNavigationMenuId": "0",
        "siteNavigationMenuType": "2"
      } 
    />

<@liferay.navigation_menu
  default_preferences=freeMarkerPortletPreferences.getPreferences(secondaryNavigationPreferencesMap)
  instance_id="secondary_navigation_menu"
/>

I do not know how to reference it via its name (here "link-utili"). I always use "marked navigation menus". Maybe someone could add this hint here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM