Page MenuHomePhabricator

exclude template's categories in certain pages
Closed, ResolvedPublic

Description

Author: stanley

Description:
In some case, we need to put a template just for display the template content as
an example, therefore, the page should not be in the same categories as other
pages contains the template.

For example: template {{delete}} contains information "this page is will be
deleted" and [[Category:Pages for deletion]].

If I put the template on article foo_vandal_article. It mean I intend to request
the page "foo_vandal_article" for deletion. But if I put the template on article
"Wikipedia:Template_list", of course I not intend to request the page
"Wikipedia:Template_list" for deletion and therefore "Wikipedia:Template_list"
should not have and be categorized into [[Category:Pages for deletion]].

It would be nice if there some tag to supress the category from the template
such as :
<nocategory>{{delete}}</nocategory>


Version: unspecified
Severity: enhancement

Details

Reference
bz4407

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:00 PM
bzimport set Reference to bz4407.
bzimport added a subscriber: Unknown Object (MLST).

stanley wrote:

There is one way to do it:(ex: template {{delete}} at comment #1)

1.Create new template {{delete-base}} contains "this page will be deleted"
2.Modify template {{delete}} contains "{{delete-base}} [[Category:Pages for
deletion]]"
3.All vandal articles will use {{delete}}
4.Wikipedia:Template_list will use {{delete-base}}
5.Modification only need to be done at {{delete-base}} / no redundant work here.

This will work, but need to create 2 pages for 1 template (I myself dont like
it). So I still request this enhancement / new syntax as comment #1

gangleri wrote:

from IRC:

Borgx is asking for <nocategory>{{delete}}</nocategory>. This would suppress the
transclusion of *all* categories.

*note*
This is not the same as
Bug 706: syntax such that a (template) page can be un-categorized, but still
categorise pages transcluding it
Bug 706 is about <foo> ... </foo> control inside the template; the actual
request is about syntax at the page where the temlate is included.

http://wiki.semen3roda.com/wiki/index.php/Template:Delete
lists itself at
http://wiki.semen3roda.com/wiki/index.php/Category:All_templates

However Borgx want to generate
http://wiki.semen3roda.com/wiki/index.php/List_of_templates
automatically without manual copying and updating.

Best regards reinhardt [[user:gangleri]]

robchur wrote:

You should avoid transcluding a load of pages on a page like that, regardless.
Just subst into a table and do periodic updates. Or list plain text:

{{[[Template:delete|]]}}

stanley wrote:

The idea of transcluding the templates into a list page is for making easy of
people whenever they want to review it. Plain text like {{[[Template:delete]]}}
or en:'s {{tl|delete}} will making it hard because one have to click the
template one by one just for seeing it.

Loading just the template's codes using {{msgnw}} also making it hard because
periodic updates is needed. Can u imagine how to maintain updates when such a
list contains 100> templates.

mediazilla wrote:

The ability to transclude a load of templates without needing to subst: and periodically update would also be useful to
average wiki users, not just maintainers of central lists. See

http://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_%28technical%
29&oldid=42611056#Suppressing_categories_for_displayed_example_tempates

A <nocategory> tag would be perfect.

Maybe a new magic word could be considered: {{nocat:some template}} would
transclude [[template:some template]] but ignore any categories included therein.

rotemliss wrote:

A workaround, implemented in some of the Hebrew projects: using a new template
named "Template Category" (in Hebrew, [[he:Template:קטגוריה בתבנית]]), which
includes (originally used the local [[Template:Qif]], I'm not sure it's the
correct syntax for #if):

{{#if: {{{NoCategory|}}} | {{{1}}}}}

and including the following text for categories:

<includeonly>{{Template Category|[[Category:Blah Blah
Blah]]|NoCategory={{{NoCategory|}}}}}</includeonly>

Then, using the parameter "NoCategory=yes" when calling a template will exclude
the category. (It can be used also for Interwiki links, etc.)

It is used successfully in the Hebrew projects, however it's just a workaround,
and we better use a new magic word.

bugs wrote:

I raised this issue at #6293 (thanks Borgx for pointing this out).

Two other possible solutions I had:

  • Allow categories to explicitly disclaim certain entries

({{exclude:Wikipedia:Template list}} on
category page)

  • Allow pages to de-categorise. In the example above, [[Remove:Category:Pages

for deletion]] on
page [[Wikipedia:Template list]].

But <nocat> would be pretty good. Something similar could be done to prevent
"what links here" from including links in transcluded pages, when desirable.

ayg wrote:

I believe this is a duplicate of Bug 835, no?

robchur wrote:

*** This bug has been marked as a duplicate of 835 ***