adding page.hasViewableChildren variable

This commit is contained in:
JT Smith 2006-04-17 21:27:07 +00:00
parent baa9eea0eb
commit 157d631d67
2 changed files with 5 additions and 1 deletions

View file

@ -366,6 +366,7 @@ sub view {
my $lineageToSkip = "noskip";
my $absoluteDepthOfLastPage;
my %lastChildren;
my $previousPageData = undef;
foreach my $asset (@{$assets}) {
# skip pages we shouldn't see
my $pageLineage = $asset->get("lineage");
@ -450,7 +451,9 @@ sub view {
$pageData->{"page.isRankedFirst"} = 1 unless exists $lastChildren{$parent->getId};
$lastChildren{$parent->getId} = $asset->getId;
}
$previousPageData->{"page.hasViewableChildren"} = ($previousPageData->{"page.assetId"} eq $pageData->{"page.parentId"});
push(@{$var->{page_loop}}, $pageData);
$previousPageData = $pageData;
}
my $counter;
for($counter=0 ; $counter < scalar( @{$var->{page_loop}} ) ; $counter++) {

View file

@ -264,12 +264,13 @@ a Google sitemap of your site.
<P dir=ltr><STRONG>page.isSibling</STRONG><BR>A conditional indicating whether this page is the sister of the base page.</P>
<P dir=ltr><STRONG>page.inBranch</STRONG><BR>A conditional that is the logical OR of <STRONG>isAncestor</STRONG>, <STRONG>isSister</STRONG>, <STRONG>isBasepage</STRONG> and <STRONG>isDescendent</STRONG>.</P>
<P dir=ltr><STRONG>page.hasChild</STRONG><BR>A conditional indicating whether this page has a daughter. In other words, it evaluates to true if this page is a mother.</P>
<P dir=ltr><STRONG>page.hasViewableChildren</STRONG><BR>A conditional indicating whether this page has a viewable child.</P>
<P dir=ltr><STRONG>page.depthIs1 , page.depthIs2 , page.depthIs3 , page.depthIs4 , page.depthIsN<BR></STRONG>A conditional indicating whether the depth of this page is N. This variable is useful if you want to style a certain level.</P>
<P dir=ltr>&lt;tmpl_if page.depthIs1&gt;<BR>&nbsp;&nbsp; &lt;img src="level1.gif"&gt;<BR>&lt;tmpl_else&gt;<BR>&nbsp;&nbsp; &lt;img src="defaultBullet.gif"&gt;<BR>&lt;/tmpl_if&gt;</P>
<P dir=ltr><STRONG>page.relativeDepthIs1 , page.relativeDepthIs2 , page.relativeDepthIs3 , page.relativeDepthIsN</STRONG><BR>A conditional indicating whether the depth of this page is N, relative to the starting page.</P>
<P dir=ltr><STRONG>page.depthDiff</STRONG><BR>The difference in depth between the previous page and this page, parent.absDepth - page.absDepth, although parent.absDepth is not a template variable.</P>
<P dir=ltr><STRONG>page.depthDiffIs1, page.depthDiffIs2, page.depthDiffIs3, page.depthDiffIsN</STRONG><BR>True if the <STRONG>page.depthDiff</STRONG> variable is N. N can be positive or negative.</P>
<P dir=ltr><STRONG>page.depthDiff_loop</STRONG><BR>A loop that runs <STRONG>page.depthDiff</STRONG> times, if <STRONG>page.depthDiff</STRONG> &gt 0. This loop contains no loop variables.</P>
<P dir=ltr><STRONG>page.depthDiff_loop</STRONG><BR>A loop that runs <STRONG>page.depthDiff</STRONG> times, if <STRONG>page.depthDiff</STRONG> &gt; 0. This loop contains no loop variables.</P>
<P dir=ltr><STRONG>page.isRankedFirst</STRONG><BR>This property is true if this page is the first within this level. ie. has no left sister.</P>
<P dir=ltr><STRONG>page.isRankedLast</STRONG><BR>This property is true if this page is the last within this level. ie. has no right sister.</P>
<P dir=ltr><STRONG>page.parent.*</STRONG><BR>These variables will be undefined if the page is a root.</P>