From c799e3b732981cfec32142fe9996f50c15443767 Mon Sep 17 00:00:00 2001 From: Len Kranendonk Date: Tue, 24 Feb 2004 09:37:15 +0000 Subject: [PATCH] Added more template variables --- lib/WebGUI/Navigation.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/WebGUI/Navigation.pm b/lib/WebGUI/Navigation.pm index 18a3e8764..3e940a88b 100644 --- a/lib/WebGUI/Navigation.pm +++ b/lib/WebGUI/Navigation.pm @@ -418,6 +418,13 @@ sub build { foreach my $property (@interestingPageProperties) { $pageData->{"page.".$property} = $page->get($property); } + $pageData->{"page.isRoot"} = (! $page->get('parentId')); + $pageData->{"page.isTop"} = ($pageData->{"page.absDepth"} == 2); + $pageData->{"page.hasDaughter"} = scalar($page->daughters); + $pageData->{"page.isMyDaughter"} = ($page->get('parentId') == + WebGUI::Page->getPage()->get('pageId')); + $pageData->{"page.isMyMother"} = ($page->get('pageId') == + WebGUI::Page->getPage()->get('parentId')); # Some information about my mother if(ref($page->mother)) { @@ -425,6 +432,9 @@ sub build { $pageData->{"page.mother.$_"} = $page->mother->get($_); } } + # Some information about my depth + $pageData->{"page.depthIs".$pageData->{"page.absDepth"}} = 1; + $pageData->{"page.relativeDepthIs".$pageData->{"page.absDepth"}} = 1; # Store $pageData in page_loop. Mind the order. if ($self->{_reverse}) {