Display Sub-pages In Categories

In the spirit of Agile programming practices where content ownership needs to be clearly identified, a useful application of Moinmoin is to display authorship using link structure (storage) and then use category assignment for classification.

This would imply that all content should live underneath a person or group's assigned path structure. Then that person or group could use category links to make this content easily discoverable to the appropriate audience.

A nice feature for the Explorer theme would be to allow sub-pages underneath any given homepage to be displayed in the wikitree underneath their respective category. Currently only pages at the root level can be displayed underneath their respective category. To simplify things, it would not be necessary to treat all sub-pages in this manner, just those sub-pages nested one level from the root.

See FacetedClassificationInMoin for more ideas on this subject.

Proposed Code Change

The following is a not-fully-tested code fragment to the file explorer.py, at line: 911.

            pos = page_name.rfind('/')
            if pos > 0:  # page is subpage
              # check to see if subpage is explicitly in a category
                parent_categories = self.categories_formatter.getCategories(page)
                if len(parent_categories) > 0:
                  # add subpage to the categories it belongs to
                  node.display_name = page_name
                  for parent_category in parent_categories:
                    self.add_to_parent(node, parent_category)
                else:
                  # add subpage to its parent folder (not a category)
                  node.display_name = page_name[pos+1:]
                  self.add_to_parent(node, page_name[:pos])
              # end of subpage handling

MoinMoin: ThemeMarket/Explorer/FeatureRequests/DisplaySubPagesInCategories (last edited 2008-12-09 21:56:49 by TonyMcDow)