--- lib/TWiki/Render.pm (working copy) +++ lib/TWiki/Render.pm (revision) @@ -95,6 +95,7 @@ my $prefix = ""; my $suffix = ""; my $usesep = ""; + my $maxElements = 0; if( $args ) { $dontRecurse = TWiki::extractNameValuePair( $args, "dontrecurse" ); @@ -102,6 +103,7 @@ $prefix = TWiki::extractNameValuePair( $args, "prefix" ); $suffix = TWiki::extractNameValuePair( $args, "suffix" ); $usesep = TWiki::extractNameValuePair( $args, "separator" ); + $maxElements = TWiki::extractNameValuePair( $args, "maxelements" ); } if( ! $usesep ) { @@ -113,6 +115,7 @@ my $sep = ""; my $cWeb = $web; + my $elementCount = 0; while( 1 ) { my %parent = $meta->findOne( "TOPICPARENT" ); @@ -127,7 +130,13 @@ if( $noWebHome && ( $pTopic eq $mainTopicname ) ) { last; # exclude "WebHome" } - $text = "[[$pWeb.$pTopic][$pTopic]]$sep$text"; + $elementCount += 1; + if( $elementCount == $maxElements ) { + $text = "...$sep$text"; + last; + } else { + $text = "[[$pWeb.$pTopic][$pTopic]]$sep$text"; + } $sep = $usesep; if( $dontRecurse || ! $name ) { last;