Fórum

Liferay 7 - Control menu

thumbnail
Ralph Koster, modificado 7 Anos atrás.

Liferay 7 - Control menu

New Member Postagens: 22 Data de Entrada: 08/11/13 Postagens Recentes
Hi everyone,

for my Liferay 7 project a created a module to customize the control menu by following this tutorial:
https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/customizing-the-control-menu

My module should display a dropdown menu in the user section of the control menu. But what happens in my case is, that my dropdown menu is displayed on a separate line of control menu (see attachment).

The following is my implementation of this hook:

@Component(
        immediate = true,
        property = {
                "product.navigation.control.menu.category.key=" + ProductNavigationControlMenuCategoryKeys.USER,
                "product.navigation.control.menu.category.order:Integer=19"
        },
        service = ProductNavigationControlMenuEntry.class
)
public class UserSettingsControlMenuEntry extends BaseJSPProductNavigationControlMenuEntry implements ProductNavigationControlMenuEntry {

    @Override
    public boolean includeIcon(HttpServletRequest request, HttpServletResponse response) throws IOException {
        return false;
    }

    @Override
    public String getIconJspPath() {
        return "/control_menu/icon.jsp";
    }

    @Override
    public String getBodyJspPath() {
        return "/control_menu/view.jsp";
    }

    /**
     * Show the menu only if current layout is not of type controlPanel
     *
     * @param request
     * @return
     * @throws PortalException
     */
    @Override
    public boolean isShow(HttpServletRequest request) throws PortalException {
        ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY);

        Layout layout = themeDisplay.getLayout();

        User user = themeDisplay.getUser();

        return !layout.isTypeControlPanel() && user != null ? true : false;
    }

    @Override
    @Reference(
            target = "(osgi.web.symbolicname=com.clavisit.brw.radar.portlet.custom-configuration)",
            unbind = "-"
    )
    public void setServletContext(ServletContext servletContext) {
        super.setServletContext(servletContext);
    }
}


Does anyone have an idea what i'm doing wrong?

thanks in advance
Ralph
thumbnail
Ralph Koster, modificado 7 Anos atrás.

RE: Liferay 7 - Control menu

New Member Postagens: 22 Data de Entrada: 08/11/13 Postagens Recentes
Hi community,

does no one have an idea what i'm doing wrong?
Any help would be appreciated.

Thanks
Ralph
thumbnail
Olaf Kock, modificado 7 Anos atrás.

RE: Liferay 7 - Control menu

Liferay Legend Postagens: 6403 Data de Entrada: 23/09/08 Postagens Recentes
How does the DOM look like? Could it be as simple as a linebreak because the CSS styles don't leave enough room for more icons? (This is a very wild guess, I didn't try the code myself...)
thumbnail
Ralph Koster, modificado 7 Anos atrás.

RE: Liferay 7 - Control menu

New Member Postagens: 22 Data de Entrada: 08/11/13 Postagens Recentes
Hi Olaf,

no there is a separate element created for my dropdown elements with CSS class control-menu-body. My elements should be included to the ul element control-menu-nav (see screenshot).

Of course I could move my elements to the right place by using Javascript. But if I don't have to, i would prefer to do it the regular Liferay way. I guess I did a mistake somewhere, but I couldn't figure it out so far...