How do I... Use web.toggle to get a whole tree?

Table of contents
    1. 1.1. Code:
    2. 1.2. In Use:
      1. 1.2.1. How do I... Access configuration settings in a DekiScript extension?
      2. 1.2.2. How do I... Apply effects to images?
        1. 1.2.2.1. Image.Polaroid
        2. 1.2.2.2. Image.Vignette
        3. 1.2.2.3. Image.Blend
        4. 1.2.2.4. Image.Rotate
        5. 1.2.2.5. Image.Raise
        6. 1.2.2.6. Image.Sink
        7. 1.2.2.7. Image.Blur
        8. 1.2.2.8. Image.Wave
        9. 1.2.2.9. Image.Swirl
        10. 1.2.2.10. Image.Emboss
        11. 1.2.2.11. Image.Flip
        12. 1.2.2.12. Image.Flop
        13. 1.2.2.13. Image.Paint
        14. 1.2.2.14. Image.Outline
        15. 1.2.2.15. Image.FitToSize
        16. 1.2.2.16. Image.Resize
        17. 1.2.2.17. Image.Charcoal
      3. 1.2.3. How do I... Break long DekiScript lines?
      4. 1.2.4. How do I... Build an Integrated Bug and Issue Tracker?
    3. 1.3. Templates
      1. 1.3.1. TicketForm
        1. 1.3.1.1. Changelog
        2. 1.3.1.2. Code
      2. 1.3.2.  Ticket
        1. 1.3.2.1. Changelog
        2. 1.3.2.2. Code
    4. 1.4. How to Install
    5. 1.5. Future releases
    6. 1.6. Example
    7. 1.7. Thanks
      1. 1.7.1. How do I... Convert Wiki.Contributors into a list of users?
      2. 1.7.2. How do I... Create a Blog in MindTouch Deki?
    8. 1.8. Summary:
    9. 1.9. The Setup:
      1. 1.9.1. How do I... Create a custom search form?
      2. 1.9.2. How do I... Create a Dynamic DekiScript dropdown menu
      3. 1.9.3. How do I... Create a dynamic link on an image?
      4. 1.9.4. How do I... Create a fancy directory page for an FAQ?
      5. 1.9.5. Step 1: Collecting the content
      6. 1.9.6. Step 1bis: Displaying a simple list
      7. 1.9.7. Step 2: Partitioning the content across two columns
      8. 1.9.8. Step 3: Displaying the columns
      9. 1.9.9. Final DekiScript Page
      10. 1.9.10. How do I... Create a flowchart or graph?
        1. 1.9.10.1. Graphviz.Dot
        2. 1.9.10.2. Graphviz.Neato­
        3. 1.9.10.3. Graphviz.Twopi
        4. 1.9.10.4. Graphviz.Circo
      11. 1.9.11. How do I... Create a page of videos from an RSS feed such as 12seconds.tv?
    10. 1.10. MindTouch is Saving Emperor Penguins
    11. 1.11. Shake your bunny tail! MindTouch at LISA
    12. 1.12. MindTouch Bunny is on it's last leg
    13. 1.13. MindTouch at LISA Conference in San Diego
    14. 1.14. MindTouch Birthday Celebrated with GALLON of Oktoberfest
      1. 1.14.1. How do I... Create a parametrized JavaScript widget?
      2. 1.14.2. How do I... Create a Picasa Image Gallery?
      3. 1.14.3. How do I... Create a simple forum in DekiScript
      4. 1.14.4. How do I... Create a tag directory for sub-pages?
    15. 1.15. Installation
    16. 1.16. Examples
          1. 1.16.1.1.1. Advanced
          2. 1.16.1.1.2. Examples
          3. 1.16.1.1.3. Extension
          4. 1.16.1.1.4. Javascript
          5. 1.16.1.1.5. JEM
          6. 1.16.1.1.6. Jquery
          7. 1.16.1.1.7. Misc
          8. 1.16.1.1.8. Xml
          9. 1.16.1.1.9. Files
          10. 1.16.1.1.10. Images
          11. 1.16.1.1.11. Mashups
          12. 1.16.1.1.12. Reports
          13. 1.16.1.1.13. Table
          14. 1.16.1.1.14. Web Services
          15. 1.16.1.1.15. Widgets
      1. 1.16.2. How do I... Create a unique document ID with a link?
      2. 1.16.3. How do I... Create an ajax discussion forum with Jquery and the Deki API
      3. 1.16.4. About this Script
      4. 1.16.5. Data Source
      5. 1.16.6. Code
      6. 1.16.7. Forum Contributors
      7. 1.16.8. Views: 
      8. 1.16.9. How do I... Create footnotes for Deki pages?
        1. 1.16.9.1. Template:Ref
        2. 1.16.9.2. Template:Note
        3. 1.16.9.3. Usage
      9. 1.16.10. How do I... Display a list of files attached to a page?
      10. 1.16.11. Sample Output
      11. 1.16.12. How do I... Display pageviews with ajax as an animated ticker
      12. 1.16.13. How do I... Embed a Google Map on a page?
        1. 1.16.13.1. Google.Map
      13. 1.16.14. How do I... Embed a Windows Live map?
        1. 1.16.14.1. Live.Map
        2. 1.16.14.2. Live.HybridMap/Live.AerialMap/Live.RoadMap
        3. 1.16.14.3. Live.Directions
        4. 1.16.14.4. Live.FindOnMap
      14. 1.16.15. How do I... Embed an image gallery?
      15. 1.16.16. Variation showing image name (contributed by graynotgrey)
      16. 1.16.17. Variation (contributed by Bryan Nelson)
      17. 1.16.18. How do I... Embed an image slideshow?
      18. 1.16.19. Variation (contributed by Bryan Nelson)
      19. 1.16.20. How do I... Embed automatically an attached file?
      20. 1.16.21. How do I... Embed Google Calendar or Spreadsheet on a page?
        1. 1.16.21.1. Google.Calendar
        2. 1.16.21.2. Google.Spreadsheet
      21. 1.16.22. How do I... Embed image depending on the description?
    17. 1.17. sample output
      1. 1.17.1. How do I... Embed mathematical formulae on a page?
      2. 1.17.2. How do I... Embed pictures from Flickr on a page?
      3. 1.17.3. Slideshows
      4. 1.17.4. Badges
      5. 1.17.5. How do I... Embed RSS feeds on a page?
        1. 1.17.5.1. Atom/RSS feeds displayed as a list
        2. 1.17.5.2. Atom/RSS feeds displayed as a table
      6. 1.17.6. How do I... Embed stock quotes from Yahoo?
        1. 1.17.6.1. Yahoo.Stockquote
        2. 1.17.6.2. Yahoo.Stockchart
      7. 1.17.7. How do I... Fetch the daily Dilbert comic strip?
    18. 1.18. How it works
    19. 1.19. Other web comics
      1. 1.19.1. How do I... Generate a TinyURL for my pages automatically?
      2. 1.19.2. How do I... Go from a tag to its definition page?
        1. 1.19.2.1. Script Source
        2. 1.19.2.2. Script in Action
      3. 1.19.3. How do I... Include content from wiki pages, sorted by most recently updated?
      4. 1.19.4. How do I... Include recent changes in a page?
      5. 1.19.5. How do I... Know which values are implicitly passed to my extension?
      6. 1.19.6. How do I... Link multiple controls together on a page?
      7. 1.19.7. How do I... Link to a particular version of a page?
      8. 1.19.8. How do I... List the most popular pages?
      9. 1.19.9. Variation for 9.02
        1. 1.19.9.1. Code
      10. 1.19.10. How do I... Make a sortable, Paginated and Zebrified Dynamic Table?
    20. 1.20. About
    21. 1.21. The Code
    22. 1.22. Configuring
    23. 1.23. Using
    24. 1.24. Noted Problems
    25. 1.25.  Example
      1. 1.25.1. How do I... Mashup a Windows Live Map with other elements on a page?
    26. 1.26. Porcini's in Boston, MA
      1. 1.26.1. How do I... Mashup Windows Live Contacts with other elements on a page?
      2. 1.26.2. How do I... Output a group of wiki pages using DekiScript?
    27. 1.27. Usage:
    28. 1.28. Output:
  1. 2. Table of contents
  2. 3. Building a Discussion Forum
    1. 3.1. Credits
    2. 3.2. The Tutorial
  3. 4. Building a Discussion Forum, Part 1: Basic Structure
    1. 4.1. Requirements
    2. 4.2. Should we use templates?
    3. 4.3. The Basic Structure
      1. 4.3.1. Page Hierarchy
      2. 4.3.2. Initializing Variables in a <div block="">
      3. 4.3.3. A Quick and Necessary Digression on the Travails of Working in the Source Editor
      4. 4.3.4. Generating the List of Topics
      5. 4.3.5. Results
    4. 4.4. File Attachments
  4. 5. Building a Discussion Forum, Part 2: Arguments and Refinements
    1. 5.1. Introduction
    2. 5.2. History
    3. 5.3. Processing a Path Argument
      1. 5.3.1. Principles of Template Arguments
      2. 5.3.2. The Path argument
      3. 5.3.3. Improved Path Processing
      4. 5.3.4. Checking for empty
    4. 5.4. Sorting the List of Topics
      1. 5.4.1. Requirements
      2. 5.4.2. Creating and Sorting a List of Maps
      3. 5.4.3. Finding the Last Author and Time
      4. 5.4.4. Type of last update
    5. 5.5. Results
    6. 5.6. File Attachments
  5. 6. Building a Discussion Forum, Part 3: The ForumTopic Template
  6. 7. Building a Discussion Forum, Part 4: Gilding the Lilly
  7. 8. Building a Discussion Forum, Part 5: Coding silly stuff just because
    1. 8.1. Introduction
    2. 8.2. History
    3. 8.3. Processing a Path Argument
      1. 8.3.1. Initialize List and Map variables
    4. 8.4. Generating the post count numbers
      1. 8.4.1. Sort the output
      2. 8.4.2. Displaying the output
    5. 8.5. Putting it all together
      1. 8.5.1. How do I... Read the Implicit Environment from within a PHP Extension?
      2. 8.5.2. How do I... Show the revision number for the current page?
      3. 8.5.3. Deki 9.02 "Lyons" or later
      4. 8.5.4. Pre Deki 9.02 "Lyons"
      5. 8.5.5. How do I... Simulate a discussion board
      6. 8.5.6. How Do I... Test my DekiScript extension?
    6. 8.6. The command line tool
      1. 8.6.1. Sample usage
    7. 8.7. Building a programmatic test harness
      1. 8.7.1. How do I... Use JEM to do PUT/POST and DELETE on RESTful APIs
      2. 8.7.2. How do I... Use jQuery to access the MindTouch API via AJAX?
      3. 8.7.3. Sample 1: Create a new property
        1. 8.7.3.1. Example
        2. 8.7.3.2. Code
      4. 8.7.4. Sample 2: Read a property
        1. 8.7.4.1. Example
        2. 8.7.4.2. Code
      5. 8.7.5. Sample 3: Update a property
        1. 8.7.5.1. Example
        2. 8.7.5.2. Code
      6. 8.7.6. Sample 4: Delete a property
        1. 8.7.6.1. Example
        2. 8.7.6.2. Code
      7. 8.7.7. What's next?
      8. 8.7.8. Update 1: Problems with ETag
      9. 8.7.9. How do I... Use web.toggle to get a whole tree?
    8. 8.8. Code:
    9. 8.9. In Use:

Code:

{{
var base = wiki.getpage("PARENT PATH");
foreach (var p in list.sort(map.values(base.subpages), "title")) {
    web.toggle(wiki.page(p.path), p.title); 
}
}}

In Use:

How do I... Access configuration settings in a DekiScript extension?

How do I... Apply effects to images?

How do I... Break long DekiScript lines?

How do I... Build an Integrated Bug and Issue Tracker?

How do I... Convert Wiki.Contributors into a list of users?

How do I... Create a Blog in MindTouch Deki?

How do I... Create a custom search form?

How do I... Create a Dynamic DekiScript dropdown menu

How do I... Create a dynamic link on an image?

How do I... Create a fancy directory page for an FAQ?

How do I... Create a flowchart or graph?

How do I... Create a page of videos from an RSS feed such as 12seconds.tv?

How do I... Create a parametrized JavaScript widget?

How do I... Create a Picasa Image Gallery?

How do I... Create a simple forum in DekiScript

How do I... Create a tag directory for sub-pages?

How do I... Create a unique document ID with a link?

How do I... Create an ajax discussion forum with Jquery and the Deki API

How do I... Create footnotes for Deki pages?

How do I... Display a list of files attached to a page?

How do I... Display pageviews with ajax as an animated ticker

How do I... Embed a Google Map on a page?

How do I... Embed a Windows Live map?

How do I... Embed an image gallery?

How do I... Embed an image slideshow?

How do I... Embed automatically an attached file?

How do I... Embed Google Calendar or Spreadsheet on a page?

How do I... Embed image depending on the description?

How do I... Embed mathematical formulae on a page?

How do I... Embed pictures from Flickr on a page?

How do I... Embed RSS feeds on a page?

How do I... Embed stock quotes from Yahoo?

How do I... Fetch the daily Dilbert comic strip?

How do I... Generate a TinyURL for my pages automatically?

How do I... Go from a tag to its definition page?

How do I... Include content from wiki pages, sorted by most recently updated?

How do I... Include recent changes in a page?

How do I... Know which values are implicitly passed to my extension?

How do I... Link multiple controls together on a page?

How do I... Link to a particular version of a page?

How do I... List the most popular pages?

How do I... Make a sortable, Paginated and Zebrified Dynamic Table?

How do I... Mashup a Windows Live Map with other elements on a page?

How do I... Mashup Windows Live Contacts with other elements on a page?

How do I... Output a group of wiki pages using DekiScript?

How do I... Read the Implicit Environment from within a PHP Extension?

How do I... Show the revision number for the current page?

How do I... Simulate a discussion board

How Do I... Test my DekiScript extension?

How do I... Use JEM to do PUT/POST and DELETE on RESTful APIs

How do I... Use jQuery to access the MindTouch API via AJAX?

How do I... Use web.toggle to get a whole tree?

Tag page
Viewing 5 of 5 comments: view all
I just tried this in three different pages (we're using MindTouch Deki v.8.08), and in different ways (adding to the page in Edit more, and also adding it in Source) and got no results. I think a bit more info on how this is used is needed. Cheers.
Posted 22:41, 26 Oct 2008
There was a bug in web.toggle in 8.08, which was fixed for 8.08.1. Also, I've cleaned up the above script a bit.
Posted 00:51, 27 Oct 2008
I keep getting this error from the map.values function: missing value for parameter 'map' (index 0)
Posted 00:16, 24 Dec 2008
If you get the error: missing value for parameter 'map' (index 0)

You may not have given wiki.getpage a proper path or page ID. To use the path of the current page, use the page.path function like:

{{
var base = wiki.getpage("page.path");
foreach (var p in list.sort(map.values(base.subpages), "title")) {
web.toggle(wiki.page(p.path), p.title);
}
}}

Posted 18:22, 15 Jan 2009
So, I am guessing that this widget will not allow one to create a standard web accordion of unordered list links to uploaded files. E.g.
<div class="ac-h" id="ac-h1"><a href="#" onclick="ac('acord1','ac-group','ac-1', 'ac-h1')" title="Click to expand/contract the section">Title of Section</a></div>
<div class="ac-group" id="ac-1">
<ul>
<li><a href="http://deki.server.com/@api/deki/files/1/=coolpowerpoint.ppt">Cool Powerpoint</a></li>
<li><a href="http://deki.server.com/@api/deki/files/2/=worddoc.doc">Word Doc</a></li>
<li><a href="http://deki.server.com/@api/deki/files/3/=information.pdf">Information</a></li>
</ul>
</div>
or something like. Is that correct or am I just not seeing how it's done?
Posted 00:59, 13 Mar 2009
Viewing 5 of 5 comments: view all
You must login to post a comment.