1 of 1 found this page helpful

Wiki.Tree

    Table of contents
    1. 1. Usage Restrictions
    2. 2. Parameters
    3. 3. Result
    4. 4. Samples
    wiki.tree(path : str, depth : num?, reverse : bool?) : xml 
    

    Insert a wiki page's subpage tree.

    Usage Restrictions

    1.8.1 or later.

    Parameters

    Name Type Description
    path str (optional in 8.08 or later, default: current page) path to the page
    depth num (optional, default: complete depth of tree) depth of children to return (1.8.2 or later)
    reverse bool (optional, default: false) list pages in reverse order (1.9.1 or later)

    Result

    A list of that directory's descendants in xml (with limited size or in reverse order)

    Samples

         Output

    A list of that directory's tree :

    {{wiki.tree("/Community/") }} 

        

    A list of that directory's tree :

    {{wiki.tree("/Community/", 1) }} 

        

    A list of that directory's tree in reverse order :

    {{wiki.tree("/Community/", 1, true) }} 

        

    Was this page helpful?
    Tag page
    Viewing 8 of 8 comments: view all
    I figured out that wiki.tree() will get me a list of links of all the subpages and down the line for the current page. Can someone tell me how to get just the next level down (i.e. child pages but not grandchildren) of the current page. I've tried wiki.tree(,1) and a few other variations to try to override the default but nothing seems to work. Thanks.
    Posted 06:33, 14 Aug 2009
    After some more digging, I found the answer: wiki.tree(page.path,1)
    Posted 06:45, 14 Aug 2009
    @BDuran, you can also do wiki.tree(_,1) or wiki.tree(_,1). Null and _ (underscore) are the same thing.
    Posted 07:32, 14 Aug 2009
    Please would anyone know how to display number of subpages instead of list of subpages depending on depth? edited 01:37, 5 Oct 2009
    Posted 01:37, 5 Oct 2009
    @strejcek for number of subpages of the current page do {{ #page.subpages }}
    Posted 06:56, 5 Oct 2009
    Thaks Steve, but would you know how to make these number visible in the wiki.tree (depth 1) in the output like this:
    Concurrent Podcast (0)
    Contributors Hall of Fame (15)
    .
    . edited 05:03, 15 Oct 2009
    Posted 05:02, 15 Oct 2009
    @strejcek for arbitrary depth tree, you'd be better off writing a SQL statement using the MySQL extension than to go down this path; otherwise, you're code will hit the DB really hard when it could have gotten all the necessary data in a single query
    Posted 09:56, 17 Oct 2009
    Is it possible to show a wiki tree including the tables of content (page.toc) of every page in the tree?
    Posted 06:30, 19 May 2011
    Viewing 8 of 8 comments: view all
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by