Question
When we click on index in our main web, we get a list of all topics in the web as a bulleted list. Clicking on Index takes to the page named
WebTopicList, whose text is simply
%INCLUDE{"TWiki06x01.HowToMakeIndentedIndex"}%
I'm wondering if there's any way to have twiki do the following:
- Show the topic list as an indented bulleted list, where the child topics are indented below their parents.
- Exclude user's pages (i.e NickNielson) from the index list.
Thanks!
Environment
--
NickNielson - 21 May 2008
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
HowToCreateNestedSearchForChildren might help. Just build a list starting a
WebHome? But some caveats:
- You don't want to go too many levels deep, for performance reasons.
- "Orphaned" pages won't show up in this index.
To exclude the user pages:
- If you use the
"excludetopic" parameter in VarSEARCH to exclude TWikiUsers, then obviously none of the child topics will appear
- if you want TWikiUsers to appear, then QuerySearchPatternCookbook has a trick for skipping personal pages.
--
SeanCMorgan - 21 May 2008
Update:
I've tried to edit the code in
HowToCreateNestedSearchForChildren but so far it hasn't worked too well. Here's what I have.
%TREEBROWSER{"file" title="The Index"}%
%SEARCH{".*" web="Main" excludetopic="TWikiUsers" format=" * $topic
$percntSEARCH{ \"parent.*$topic\" web=\"Main\" format=\" * $dollartopic
$dollarpercntSEARCH{ \\"parent.*$dollartopic\\" web=\\"Main\\" format=\\" * $dollardollartopic \\"
}$dollarpercnt \"
}$percnt"
}%
Any ideas on what's wrong here?
Thanks!
--
NickNielson - 22 May 2008
Sorry, I should have given you a TWiki 4.2 example to work with: I've found that the parent searches work differently. And I don't have TREEBROWSER installed, so I don't know it's impact. So I started with a different example instead, one I wrote for
HowDoICountTopicsOnAPageAndDisplay, only without the counts.
See
SiteMapUsingNestedSearch for an example. Note that if you try to create an indented index for TWiki.org's Main web, it takes a couple of minutes to load because there are so many users. So instead I set to index the TWiki web by default.
I had to use
separator="" to suppress the newline (and explicitly insert a newline with
$n where I needed it) to prevent blank lines where there were no children of a page.
P.S. the escaping is described at
VarSEARCH in the section, "Nested Search".
--
SeanCMorgan - 22 May 2008
Thanks, that works very well.
--
NickNielson - 23 May 2008
In case you're still monitoring this closed question, a much easier way to do this is with the
TreePlugin. Additionally,
TreeBrowserPlugin lets you expand/collapse the tree that the first plugin generates. See
HowToEditWebTopicList for a screenshot, and complete instructions.
--
SeanCMorgan - 07 Aug 2008
Thanks Sean.
HowToEditWebTopicList worked for me. However, the index that I made using the large, complex "search" above is nice because it just lists all topics under
WebHome. Is there any way to modify the parameters of the
HowToEditWebTopicList so that it only lists
WebHome, its children, grandchildren, etc?
Thanks,
Nick
--
NickNielson - 08 Aug 2008
TreePlugin lets youspecify the tree's root topic (e.g.,
topic=WebHome).
As you can probably tell, I'm less of a fan of nested searches now than I was two months ago.
--
SeanCMorgan - 08 Aug 2008
Oops, should have just read the documentation on that one. Thanks.
--
NickNielson - 11 Aug 2008