Really more of a code clean-up than a bug (given current functionality).

Like some others, I wanted to display subpages in categories. Unlike the patch there, I wanted the subpages to appear both under their parent pages and in their categories. In the course of figuring out how to do that, I saw that the path in subtree_html gets everything twice, and keeps it. That is, every path length is a multiple of 2, and the ones at the bottom are longer than those at the top, even if logically they are shorter, because the path is never popped.

My solution was to put

        path = path or []

at the top of subtree_html, and then to simplify and pop at the bottom:

           if display_subtree:
                path.append(node_name)
                display_all = display_all or id == self.expand_subtree
                items.append(u'<ul class="wiki_tree">')
                for sub_node_name in sub_nodes:
                    [...]
                items.append(u'</ul>')
                path.pop()
        return u'\n'.join(items)

--DavidMontgomery

MoinMoin: ThemeMarket/Explorer/Bugs/SubtreeHtmlGetsRedundantPath (last edited 2009-05-25 09:52:37 by c-98-207-94-210)