Description
There is a page named CategoryTemplate. I am told that it is a template to be used for creating new categories. Unfortunately, it could (and is) also interpreted as a Category:
CategoryCategory on MoinMaster
The problem is that the name CategoryTemplate meets the criteria for both a category (CategoryXxxxx) and for a template (XxxxxxTemplate). This is confusing if you don't know the story, because if you look at the contents of CategoryTemplate, it could easily be mistaken for a category that should be placed on every template. I had this misunderstanding, as did at least one other user as evidenced by this Bug Report.
Steps to reproduce
Visit one of the links above and find CategoryTemplate listed as a Category. It is really a template.
Example
Component selection
- general
Details
Workaround
Discussion
Something should be done to prevent the CategoryTemplate page from showing up in category lists?
The hilarious thing is that CategoryTemplate has the link CategoryCategory on it, declaring it as a category! (It's been this way since 2004.) Oops. More proof that this page is confusing?? (See http://moinmaster.wikiwikiweb.de/CategoryTemplate?action=info)
OK, after getting some sleep, I realize that CategoryCategory is in the template so that category pages created from it will be classified as categories. But confusing nonetheless.
This is my proposed solution:
- Add a comment to the template making it crystal clear that it is a template, not a category
rename it to "CategoriesTemplate" so that it no longer meets the rules for being a category.
Or change page_category_regex to (?P<all>Category(?P<key>(?!Template)\S+)). This prevents CategoryTemplate from being offered in the 'add to <category' dropdown when editing a page, but it [[still shows up on CategoryCategory.
- Create a new "null" variable that expands to nothing (e.g. @@, or @null@) and place it inside Category@@Category so that the template itself does not classify itself as a category, but pages created from it will.
A long term solution must use meta data to specify page type, instead of the too loose link-to-CategoryXxxx system. This will allow using sane names for categories, instead of the CategoryCategory stupidity.
Plan
Suggested plan:
Change page_category_regex to exclude CategoryTemplate
fixed in 1.8 by changeset 3823:262738c1f46b
fixed in 1.7 by http://hg.moinmo.in/moin/1.7/rev/a7db3c488083
Exclude CategoryTemplate from category: searches exclude-category.patch
- Why is that needed?
I was annoyed that CategoryTemplate appears on CategoryCategory as a possible category, when it is not a cateogry -- it is a template. So my first thought was to hack searches for category:CategoryCategory to exclude CategoryTemplate. But I implemented it wrong, and actually excluded CategoryTemplate from all categories. Having throught about this further, I would like to create templates on my wiki such as BugTemplate that add pages to CategoryBug -- but BugTemplate is not a bug, so it shouldn't itself be in the category. So my latest thought is: exclude anything that matches page_template_regex from category searches. Does that make sense?
- Why is that needed?
- Priority:
- Assigned to:
- Status: