2 Replies Latest reply on Nov 30, 2007 3:48 PM by - -

    Get page name during layout rendering

    - - Newbie


      What's the recommended way to access page information (e.g. : its name, its type, ...) during layout rendering (with JSP layout) ?

      I need this to display a breadcrump. The only way I've found is to define it in the navigation region, but I wish I could move the output code outside the header.

      You can use Navigation.getCurrentNode() inside portlet or navigation tabs, but this doesn't work inside the layout JSP since the servlet request is not populated the same way (cf. LayoutDispatcher).

      I can't imagine you can't display the page name using the layout JSP, how do you achieve that ?


        • 1. Re: Get page name during layout rendering
          Jon Whitmore Newbie

          This might not be the elegant solution you were hoping for, but you can use request.getPathInfo(); and parse your page name out of it. That's what I'm doing in my menu.jsp, which is included in the layout.jsp.

          • 2. Re: Get page name during layout rendering
            - - Newbie

            Yes, this would work for breadcrumbs, even though you have to make assumptions to stop at portal root when reading parent path.

            But this would not work when building navigation menu beacause you need more information than page name. I use 'navigation' region to display top pages, and I build a tree-menu of nested pages inside layout. I only could build this menu inside 'navigation' region and display it elsewhere in the page because I've implemented it with Javascript.

            I find layout management too rigid, hope it will be more flexible with next releases.