Author: andre Date: 2009-11-26 18:13:24 +0100 (Thu, 26 Nov 2009) New Revision: 39986
Modified: openimages/trunk/mmsite/src/main/config/functions/mmsite.xml openimages/trunk/mmsite/src/main/java/org/mmbase/mmsite/UrlUtils.java Log: to make this function usefull it has to be reversed Modified: openimages/trunk/mmsite/src/main/config/functions/mmsite.xml =================================================================== --- openimages/trunk/mmsite/src/main/config/functions/mmsite.xml 2009-11-26 17:03:51 UTC (rev 39985) +++ openimages/trunk/mmsite/src/main/config/functions/mmsite.xml 2009-11-26 17:13:24 UTC (rev 39986) @@ -11,7 +11,7 @@ </description> <type>class</type> <class>org.mmbase.mmsite.UrlUtils</class> - <method>listNodes2Root</method> + <method>crumbs</method> <param name="node" type="Node" description="A node f.e. of type page" /> <return type="org.mmbase.bridge.NodeList" /> </function> Modified: openimages/trunk/mmsite/src/main/java/org/mmbase/mmsite/UrlUtils.java =================================================================== --- openimages/trunk/mmsite/src/main/java/org/mmbase/mmsite/UrlUtils.java 2009-11-26 17:03:51 UTC (rev 39985) +++ openimages/trunk/mmsite/src/main/java/org/mmbase/mmsite/UrlUtils.java 2009-11-26 17:13:24 UTC (rev 39986) @@ -1,10 +1,9 @@ package org.mmbase.mmsite; +import java.util.Collections; import javax.servlet.http.HttpServletRequest; import org.mmbase.bridge.*; - - import org.mmbase.util.logging.Logger; import org.mmbase.util.logging.Logging; @@ -30,6 +29,18 @@ } /** + * Nodes starting form this node to the root, these require a field 'path'. + * + * @param node A node of some type with a field 'path' + * @return list with all the nodes leading to the homepage including the present node + */ + public static NodeList crumbs(Node node) { + NodeList l = listNodes2Root(node); + Collections.reverse(l); + return l; + } + + /** * Retrieve a pages node with a certain path. * * @param cloud MMBase cloud _______________________________________________ Cvs mailing list Cvs@lists.mmbase.org http://lists.mmbase.org/mailman/listinfo/cvs