When a trail includes its index page among the members, the pages
before/after it will have â\80\9cdouble linksâ\80\9d to the index page (both as
next/prev and as 'up') and the index page will include an 'up' link to
itself.
Prevent this by not defining the appropriate template variables when the
index page is member of the trail itself. The default page template is
also adapted to skip the link at all in this case.
$nexttitle = title_of($next);
}
$nexttitle = title_of($next);
}
prevpage => $prev,
prevtitle => $prevtitle,
prevurl => $prevurl,
nextpage => $next,
nexttitle => $nexttitle,
nexturl => $nexturl,
prevpage => $prev,
prevtitle => $prevtitle,
prevurl => $prevurl,
nextpage => $next,
nexttitle => $nexttitle,
nexturl => $nexturl,
- trailpage => $trail,
- trailtitle => title_of($trail),
- trailurl => urlto($trail, $page),
+ );
+
+ # the trail index is added as 'up' page, but only if it's
+ # not a page in the trail itself. This allows the definition of
+ # up-less trails by using e.g. the trailitems directive in one of the
+ # pages of the trail
+ unless ($trail ~~ @$members) {
+ $trail_info{trailpage} = $trail;
+ $trail_info{trailtitle} = title_of($trail);
+ $trail_info{trailurl} = urlto($trail, $page);
+
+ push @trails, \%trail_info;
}
$template->param(trailloop => \@trails);
}
$template->param(trailloop => \@trails);
<TMPL_IF PREVPAGE>
<link rel="prev" href="<TMPL_VAR PREVURL>" title="<TMPL_VAR PREVTITLE>" />
</TMPL_IF>
<TMPL_IF PREVPAGE>
<link rel="prev" href="<TMPL_VAR PREVURL>" title="<TMPL_VAR PREVTITLE>" />
</TMPL_IF>
<link rel="up" href="<TMPL_VAR TRAILURL>" title="<TMPL_VAR TRAILTITLE>" />
<link rel="up" href="<TMPL_VAR TRAILURL>" title="<TMPL_VAR TRAILTITLE>" />
<TMPL_IF NEXTPAGE>
<link rel="next" href="<TMPL_VAR NEXTURL>" title="<TMPL_VAR NEXTTITLE>" />
</TMPL_IF>
<TMPL_IF NEXTPAGE>
<link rel="next" href="<TMPL_VAR NEXTURL>" title="<TMPL_VAR NEXTTITLE>" />
</TMPL_IF>
<span class="trailsep">|</span>
</span>
</TMPL_IF>
<span class="trailsep">|</span>
</span>
</TMPL_IF>
<span class="trailup">
<a href="<TMPL_VAR TRAILURL>"><TMPL_VAR TRAILTITLE></a>
</span>
<span class="trailup">
<a href="<TMPL_VAR TRAILURL>"><TMPL_VAR TRAILTITLE></a>
</span>
<TMPL_IF NEXTPAGE>
<span class="trailnext">
<span class="trailsep">|</span>
<TMPL_IF NEXTPAGE>
<span class="trailnext">
<span class="trailsep">|</span>