Item8399: New $leveltoken format variable, like levelprefix but can use in format

pencil
Priority: Enhancement
Current State: Waiting for Feedback
Released In:
Target Release: n/a
Applies To: Extension
Component: TreePlugin
Branches:
Reported By: Foswiki:Main.DiabJerius
Waiting For: Main.DiabJerius
Last Change By: PaulHarvey
I've attached a patch which implements a new parameter leveltoken and an associated format pseudo-variable $leveltoken.

$leveltoken is just like the levelprefix parameter, except that one can use it within the format output. Why is this useful? I'm generating a table from the topic tree and want to provide a visual clue of the nesting of topics. I can't use levelprefix for this as I can't place it where I need inside the format. For example, I'd like to introduce appropriate spacing in front of a topic name to show it's level. Here's what my proposed enhancement looks like:

%TREEVIEW{
    formatting="outline"
    includetopic="Task0*"
    header="| *Topic* | *Parent* | *level* | *count* | *index* | *outnum* |"
    format="| $leveltoken$topic | $parent | $level | $count | $index | $outnum |"
    nodiv="2"
    leveltoken=" "
}%

And here's the rendered output:

table.png

-- DiabJerius - 20 Jan 2010

Excellent addition. I don't use this plugin so much anymore, and lack the time to take responsibility for this patch. Maybe somebody else does.

Do you have svn commit access? If not, you should request it at Development.RequestAccessToSubversion. We can help you through making the change and uploading a new release of TreePlugin on IRC

TreePlugin could really use some TLC!

-- PaulHarvey - 27 Jan 2010
 

ItemTemplate edit

Summary New $leveltoken format variable, like levelprefix but can use in format
ReportedBy Foswiki:Main.DiabJerius
Codebase
SVN Range 6093
AppliesTo Extension
Component TreePlugin
Priority Enhancement
CurrentState Waiting for Feedback
WaitingFor DiabJerius
Checkins
TargetRelease n/a
ReleasedIn
I Attachment Action Size Date Who Comment
TaskPlugin.diffdiff TaskPlugin.diff manage 5 K 20 Jan 2010 - 16:49 DiabJerius Diff to revision 6093
table.pngpng table.png manage 10 K 20 Jan 2010 - 15:56 DiabJerius rendered table
Topic revision: r2 - 27 Jan 2010, PaulHarvey
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy