From 5cc870a4b3d426af53044610ffd306591a54c23e Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 8 Jul 2016 09:22:54 +0200 Subject: [PATCH] =?utf8?q?Projekt-Seite=20erstellt:=20Velocity-Template=20?= =?utf8?q?-=20Einlesen=20der=20Daten=20=C3=BCberarbeitet?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Die Breadcrumb-Pfade werden beim Einlesen der Menüdaten für alle Seiten mit erzeugt. --- src/site/template.vm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/site/template.vm b/src/site/template.vm index c91a1b2..2577a89 100644 --- a/src/site/template.vm +++ b/src/site/template.vm @@ -26,14 +26,25 @@ #set ( $page = $stack.pop() ) #if ( $page.uri != "" ) + #set ( $crumbs = $project.getClass().forName('java.util.LinkedList').newInstance() ) + #foreach ( $entry in $stack ) + #if ( $entry.uri != "" ) + #set ( $crumb = $project.getClass().forName('java.util.LinkedHashMap').newInstance() ) + #set ( $sinkhole = $crumb.put("uri", $entry.uri) ) + #set ( $sinkhole = $crumb.put("name", $entry.name) ) + #set ( $sinkhole = $crumbs.push($crumb) ) + #end + #end + #set ( $sinkhole = $page.put("crumbs", $crumbs) ) + #if ( $pages.containsKey($page.uri) ) #set ( $childs = $pages.get($page.uri).childs ) #set ( $sinkhole = $page.put("childs", $childs) ) - + #else - + #end #set ( $sinkhole = $pages.put($page.uri, $page) ) -- 2.20.1