Search code examples
liferay-themeliferay-velocityliferay-7

How to delete the Navigation Menu title in liferay theme?


I created a theme and copied the navigation.ftl from Liferay Classic Theme but in my theme, The navigation title is showing up as shown in the below screen-shot.

enter image description here

If I am logged in as an Administrator, I am able to edit the text and make it blank and Save and it goes away. But when i refresh the page, it comes back which i think is a bug.

But my question is, What do i do in the theme so that the title doesn't show up at all anywhere.

The code snippet from navigation.ftl

<#assign VOID = freeMarkerPortletPreferences.setValue("portletSetupPortletDecoratorId",     "barebone") />

<div aria-expanded="false" class="collapse navbar-collapse" id="navigationCollapse">
<#if has_navigation && is_setup_complete>
    <nav class="${nav_css_class} site-navigation" id="navigation" role="navigation">
        <div class="navbar-right">
            <@liferay.navigation_menu default_preferences="${freeMarkerPortletPreferences}" />
        </div>
    </nav>
</#if>
</div>

<#assign VOID = freeMarkerPortletPreferences.reset() />

Solution

  • I had the same issue and found that in my custom theme (starting from the Styled theme using the Theme Generator) the portlet.ftl file had the line:

        <h2 class="portlet-title-text">${portlet_title}</h2>
    

    The portlet.ftl in the Classic theme has:

        <#if portlet_display.getPortletDecoratorId() != "barebone">
            <h2 class="portlet-title-text">${portlet_title}</h2>
        </#if>
    

    I added that #if statement around the h2 to my portlet.ftl and now the title is not displayed if Barebone is the chosen decorator for a portlet. This works whether Barebone is set through a template or through the Look and Feel menu in the admin.