Wiadomosc od Jacek Wiślicki z 2005-09-19 19:50 brzmiala:

Wiadomosc od Ioannis Kanellopoulos z 2005-09-19 17:35 brzmiala:

We require to have the top level navigation menu (root folders) visible at all times, instead of having a link through "back to root folder" or to "root" depending on the decoration use for the layout. Is this possible? and if yes can you please indicate how we can do this?

I have extended JetspeedPowerTool with a method displaying the current path (each element is presented as a link), e.g.
'root folder' -> 'directory 1' -> 'directory 1.1' -> 'current page'
/**
* Retrieves a current path in the portal structure in a form of HTTP
* links. For velocity macros use: $jetspeed.getCurrentPath()
* @author Jacek Wiślicki
* @version 2005-09-12
* @return current path
*/
public String getCurrentPath()
{
   String basePath = getBasePath();
   Node currentSite = requestContext.getPage();

   Vector path = new Vector();
   buildNodePath(currentSite, path);

   String displayPath = "";
   for(int i = 0; i < path.size(); i++)
   {
      Node node = (Node)path.get(i);
      displayPath +=
         "<a href=\"" + basePath + node.getPath() + "\">" +
            node.getShortTitle(locale) +
         "</a> &rarr; ";
      if(node.equals(path.lastElement()))
         displayPath += " &rarr; " + currentSite.getShortTitle(locale);
   }

   return displayPath;
}

It's quite useful, I think...
Oops, I've forgotten about one more method for JPT:
/**
* Builds reqursively a node path for a given page.*
* @author Jacek Wiślicki
* @version 2005-09-12
* @param page subsequent page in the iterration
* @param path Vector stores path elements
*/
private void buildNodePath(Node page, Vector path)
{
   Node parent = page.getParent();
   if(parent != null)
   {
      path.insertElementAt(parent, 0);
      buildNodePath(parent, path);
   }
}

--
pozdrawiam,
    Jacek Wislicki

[EMAIL PROTECTED]
tel.: +48 502 408 444
gg: 2540358
skype: jacek_wislicki

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to