[opencms-dev] How to open an external link from navigation in a new window

Martin Hoeller martin.hoeller at xss.co.at
Mon May 8 14:27:55 CEST 2006


Am Monday 08 May 2006 14:06 schrieb Uwe König:
> Hello Martin,
>
> > I'm trying to figure out how to open an external link that is part of
> > my navigation menu in a new browser window. I searched the archives but
> > the
>
> How do you generate your navigation-menu? If you have a JSP-Template, it
> should be easy to write out the link with target="_blank". Best regards,

I couldn't see the wood for the trees... thx for the hint!

Just for the archieves, here is how I implemented my navigation with support 
for a property "Target":

  List  list = cms.getNavigation().getNavigationForFolder();
  Iterator i = list.iterator();
  while (i.hasNext()) {
      CmsJspNavElement current_element = (CmsJspNavElement)i.next();

        if (current_element.getResourceName().equals(filename) ||
            current_element.getResourceName().equals(foldername)) {
            out.print(current_element.getNavText());
        } else {
            out.print("<a class=\"menu\"");
            if (current_element.getProperty("Target") != null) {
                out.print(" target=\""
                  + current_element.getProperty("Target") + "\"");
            }
            out.print(" href=\""
                  + cms.link(current_element.getResourceName()) + "\">" 
                  + current_element.getNavText() + "</a>");			
        }
    }

many thanks again,
- martin

-- 
    mailto:martin.hoeller at xss.co.at  | As far as we know, our computer
http://stud3.tuwien.ac.at/~e9926483  | has never had an undetected error.
                       icq:45563199  |                      -- Weisert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060508/bd3d5371/attachment.sig>


More information about the opencms-dev mailing list