Index: app/helpers/application_helper.rb
===================================================================
--- app/helpers/application_helper.rb	(revision 2903)
+++ app/helpers/application_helper.rb	(working copy)
@@ -132,7 +132,7 @@
     end
   end
 
-  def render_page_hierarchy(pages, node=nil)
+  def render_page_hierarchy(pages, node=nil, maxnesting=nil, curnesting=0)
     content = ''
     if pages[node]
       content << "<ul class=\"pages-hierarchy\">\n"
@@ -140,7 +140,7 @@
         content << "<li>"
         content << link_to(h(page.pretty_title), {:controller => 'wiki', :action => 'index', :id => page.project, :page => page.title},
                            :title => (page.respond_to?(:updated_on) ? l(:label_updated_time, distance_of_time_in_words(Time.now, page.updated_on)) : nil))
-        content << "\n" + render_page_hierarchy(pages, page.id) if pages[page.id]
+        content << "\n" + render_page_hierarchy(pages, page.id, maxnesting, curnesting + 1) if pages[page.id] and (maxnesting.nil? or curnesting < maxnesting)
         content << "</li>\n"
       end
       content << "</ul>\n"
Index: lib/redmine/wiki_formatting/macros.rb
===================================================================
--- lib/redmine/wiki_formatting/macros.rb	(revision 2903)
+++ lib/redmine/wiki_formatting/macros.rb	(working copy)
@@ -89,9 +89,10 @@
       desc "Displays a list of child pages. With no argument, it displays the child pages of the current wiki page. Examples:\n\n" +
              "  !{{child_pages}} -- can be used from a wiki page only\n" +
              "  !{{child_pages(Foo)}} -- lists all children of page Foo\n" +
-             "  !{{child_pages(Foo, parent=1)}} -- same as above with a link to page Foo"
+             "  !{{child_pages(Foo, parent=1)}} -- same as above with a link to page Foo\n" +
+             "  !{{child_pages(Foo, parent=1, maxnesting=1)}} -- maximum nesting of 1 (show only Foo and direct children)"
       macro :child_pages do |obj, args|
-        args, options = extract_macro_options(args, :parent)
+        args, options = extract_macro_options(args, :parent, :maxnesting)
         page = nil
         if args.size > 0
           page = Wiki.find_page(args.first.to_s, :project => @project)
@@ -102,7 +103,7 @@
         end
         raise 'Page not found' if page.nil? || !User.current.allowed_to?(:view_wiki_pages, page.wiki.project)
         pages = ([page] + page.descendants).group_by(&:parent_id)
-        render_page_hierarchy(pages, options[:parent] ? page.parent_id : page.id)
+        render_page_hierarchy(pages, options[:parent] ? page.parent_id : page.id, options[:maxnesting].to_i)
       end
       
       desc "Include a wiki page. Example:\n\n  !{{include(Foo)}}\n\nor to include a page of a specific project wiki:\n\n  !{{include(projectname:Foo)}}"
