diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 75c4b2298..cd4e482b0 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -18,6 +18,8 @@ - bugfix [ 996284 ] Compile error in macro.pm - bugfix [ 997918 ] Default value in profile not working - bugfix [ 997916 ] Bug and solution in File.pm + - Added the page.isMyAncestor condition to the Navigation system. (Thanks to + Len Kranendonk) 6.1.1 - bugfix [ 991313 ] Manage Translations doesn't work diff --git a/lib/WebGUI/Navigation.pm b/lib/WebGUI/Navigation.pm index bac2cd19b..719ce6444 100644 --- a/lib/WebGUI/Navigation.pm +++ b/lib/WebGUI/Navigation.pm @@ -305,6 +305,11 @@ sub build { $pageData->{"page.inCurrentRoot"} = (($page->{'lft'} > $currentPage->get('lft')) && ($page->{'rgt'} < $currentPage->get('rgt'))) || (($page->{'lft'} < $currentPage->get('lft')) && ($page->{'rgt'} > $currentPage->get('rgt'))); + + # Anchestor info + foreach my $ancestor ($currentPage->ancestors) { + $pageData->{"page.isMyAncestor"} += ($ancestor->{'pageId'} == $page->{'pageId'}); + } # Some information about my mother my $mother = WebGUI::Page->getPage($page->{parentId}); diff --git a/lib/WebGUI/i18n/English/WebGUI.pm b/lib/WebGUI/i18n/English/WebGUI.pm index 26cd9067d..17ab15b0a 100644 --- a/lib/WebGUI/i18n/English/WebGUI.pm +++ b/lib/WebGUI/i18n/English/WebGUI.pm @@ -6988,6 +6988,7 @@ Following a guide like the above will help you get good ranking on search engine

page.isTop
A condition indication whether this page is a top page (daughter of root).

page.inCurrentRoot
This condition is true if this page is a descendant of the root page of the current page

page.hasDaughter
A condition indication whether this page has a daughter. In other words: It evaluates to true if this page is a mother.

+

page.isMyAncestor
A condition indication whether this page is an ancestor of current page.

page.isMyDaughter
A condition indication whether this page is a daughter of current page.

page.isMyMother
A condition indication whether this page is the mother of current page.

page.mother.title
The title of the mother of this page.