Template talk:Redirect template

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Redirect
WikiProject icon This page is within the scope of WikiProject Redirect, a collaborative effort to improve the standard of redirects and their categorization on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Note: This banner should be placed on the talk pages of project, template and category pages that exist and operate to maintain redirects.
This banner is not designed to be placed on the talk pages of most redirects and never on the talk pages of mainspace redirects. For more information see the template documentation.
 

Incorrect namespace template[edit]

Maybe there is a way to subdue this {{Incorrect namespace}} template entirely when an Rcat can be used cross-namespace? Mclay1, you seem to have a much better handle on the template code than I do. You might check out the recent edits at {{R from plural}}, where I collaborated with Martin to subdue the Unprintworthy redirects cat in favor of the Printworthy redirects cat on a few special redirects. Maybe the elegant code Martin used will give us a clue as to how to deal with the challenges of this template?  — Paine Ellsworth ( CLIMAX )  23:42, 22 February 2011 (UTC)

If a redirect template is used for cross-namespace redirects, then {{Incorrect namespace}} will not be transcluded. Its only transcluded if a redirect template is used on a namespace it was not intended for. For example, if a redirect template uses only the main category category parameter, the category will only be added to main namespace pages and {{Incorrect namespace}} will be added to non-main namespace pages. If the main category and other category parameters are used, one category will be added to the main namespace and another category will be added to all other namespace but {{Incorrect namespace}} will not be added. McLerristarr | Mclay1 04:38, 23 February 2011 (UTC)
Then perhaps I don't understand the problem as you've described it at the bottom of the /doc page: "This template automatically adds templates it is directly transcluded on to Category:All redirect templates. At the moment, the category is also added to template namespace pages that transclude redirect templates using this templates. Until this setback has been fixed, this template should not be used on redirect templates that can be used on template namespace pages." What then is specifically wrong that needs to be fixed?  — Paine Ellsworth ( CLIMAX )  00:31, 24 February 2011 (UTC)
If a redirect template using this template is used on a template namespace page, it will add the redirect to Category:All redirect templates. Only the templates this template is transcluded on should be categorised, not templates that transclude a template that transcludes this template. I don't know how to fix it. McLerristarr | Mclay1 03:20, 24 February 2011 (UTC)

printworthy=[edit]

I just tried using the printworthy parameter at {{R from ATC code}}. Prior to this test of the {{Redirect template}} template, I had used {{Main other|[[Unprintworthy redirects]}} on the Rcat itself, and Category:Templates for unprintworthy redirects "includeonly'd" on the /doc page. According to the last paragraph of the /doc page for this "Redirect template", if the printworthy=no parameter is used, then the Rcat should automatically be added to the Templates for unprintworthy redirects cat. This does not appear to be the case. So I intend to revert my edits at {{R from ATC code}} and rm that paragraph on this doc page and bring it here to this talk page until resolved. Here it is:

Also, there are other anomalies with this template, both as noted on the /doc page, and as may be seen in an analysis of my reverted edits on this date at {{R from ATC code}}. – PIE ( CLIMAX )  06:30, 12 February 2012 (UTC)

Okay, this has begun to work again; however, I am not convinced why it is needed. Can someone more versed please explain why it is necessary to automatically put template redirects into the Category:Templates for unprintworthy redirects, which is usually limited to Rcat templates that possess this ability to categorize redirects? – Paine Ellsworth CLIMAX! 01:45, 8 August 2013 (UTC)

I see why it's needed now. It is not supposed to be seen on redirects; it is only supposed to categorize the Rcat itself that uses it and that has the printworthy= param enabled. – Paine Ellsworth CLIMAX! 16:44, 19 December 2013 (UTC)

Should redirects get feedback?[edit]

I'm not confident of correctly adding Category:Article Feedback Blacklist to the template, would a soul braver than I do so? Josh Parris 23:36, 26 February 2012 (UTC)

Is the consensus now to blacklist redirects from feedback? I only ask because I did not know that the feedback blacklist extended beyond dab pages. – PIE ( CLIMAX )  01:27, 5 March 2012 (UTC)

Inquiry[edit]

Please note my inquiry in the printworthy= section above. – Paine Ellsworth CLIMAX! 01:49, 8 August 2013 (UTC)

Proposal[edit]

To alter this template so it can be used on template redirects.

  • Template redirect: any redirect that is in template namespace
  • Redirect template: a template that is used to tag redirects and sort them into categories – see WP:RCAT

The ultimate goal is to be able to sort template redirects that are incorrectly tagged with the wrong Rcats into Category:Pages with templates in the wrong namespace so they can be found, tagged and sorted into the correct category(ies).

Detail[edit]

There are two functions of the Redirect template template, together with the {{Incorrect namespace}} template, that need to be changed. The first goal is to stop this template from making all templates populate Category:All redirect templates when this template is used to tag them. There is no reason for this, since all redirect (category) templates (aka "Rcats") are already categorized by a /doc-page category link to the All redirect templates category. Disabling this will enable editors to use this template on Rcats that can tag "template redirects" that are not Rcats and that should not be sorted into the All redirect templates category.

The second challenge stems from this template's usage of the {{Incorrect namespace}} template. Most of the function of template Incorrect namespace is vital to this template. It provides this template with a notice that an Rcat has been wrongly used to tag a redirect in a namespace other than that for which the Rcat was intended. Even more importantly it places an incorrectly tagged redirect into CAT:WRONG, which is a category for Pages with templates in the wrong namespace. That category has recently been cleared, but there are still template redirects that are incorrectly tagged with no way of finding them until we alter this Redirect template template. The other template, Incorrect namespace, should not be changed because it is used in many other templates besides this one. A similar template exists that can replace the Incorrect namespace template in this Redirect template template. The replacement of the Incorrect namespace template with that template, {{Incorrect redirect template}}, is also a part of this proposal.

As a third part of this proposal, user namespace can also be included in this template. The code at {{Redirect template/sandbox}} contains the code necessary to include user namespace. That sandbox code is ready to "go live" as soon as discussion about this proposal allows.

Code edit[edit]

The code that needs to be omitted as part of this proposal to make the Redirect template template work correctly on template pages is as follows:

== Template category ==

--><includeonly>{{#ifeq:{{SUBPAGENAME}}|doc||{{Template other|{{{category|[[Category:All redirect templates]]}}}}}}}</includeonly><!--

This code has been erased from the /sandbox version. In addition to the omission of this code and the addition of user namespace, the /sandbox version has replaced all occurrences of the Incorrect namespace template with the Incorrect redirect template template. Again, this means that the "05:20, December 22, 2013" version in the sandbox is ready to replace the live version.

Thank you for reading! – Paine Ellsworth CLIMAX! 06:00, 22 December 2013 (UTC)

Discussion[edit]

Updates:
  1. Since no discussion has been generated by this proposal, so no objection to it has been raised, I shall implement the change in a few hours. Joys to all! – Paine Ellsworth CLIMAX! 03:55, 31 December 2013 (UTC)
  2. This proposal went into effect with this edit on 31 December 2013. – Paine Ellsworth CLIMAX! 17:13, 31 December 2013 (UTC)

Recent disposal of Incorrect redirect template[edit]

To Technical 13: This is to talk about your recent edit that disposed of a crucial and integral part of {{Redirect template}} – the {{Incorrect redirect template}}. I have a proposal for you after I give a brief explanation as to why Incorrect redirect template is so important to Redirect template.

  • I have sandboxed your edit to help explain. In one of my own sandboxes, sandbox 7, you can see one of several results of your edit. It does accomplish placement of the rcat text on the page and does not sort to the Unprintworthy redirects category. And yet, please take a close look at the text. Like all rcats, that text is designed to explain to readers why a given redirect is sorted into a given category. That is the sole purpose of rcat text! Hopefully, you can understand why rcat text does not meet your expectations on redirect pages that are not sorted into the rcat's category.
  • Another of my sandboxes, sandbox 7a, has been set up to show how it is supposed to appear. This is important for those of us who monitor the redirect categories to know when an rcat has been mistakenly used to tag a redirect in a namespace other than that for which the rcat is designed. And it sends up a "loud" flag so, hopefully, editors will catch the error on preview, or at least they will see the error box when they save their edit, and then self-revert.
  • Here is what I propose: I suggest that the explanatory text you and other contributors want on redirects be incorporated into a new set of templates that are designed just for that purpose. That way, you will be able to tag a given redirect with the precise text you want – not text that conforms only to the categorization of the redirect – you can devise a more appropriate, more applicable explanation that does not imply that the redirect is going to populate a certain category.

It is sometimes a challenge for me to write with clarity. I sincerely hope that I have made it clear why Incorrect redirect template should remain in this template to perform its necessary purpose. I also hope that I have been helpful with a proposal to do a better job of what you want to do. If I have not been clear enough, I will be happy to answer any questions you may have. Joys! – Paine Ellsworth CLIMAX! 09:37, 9 March 2014 (UTC)

  • Hi Technical 13. I've noticed that you've been declining quite a few edit requests that want {{R from alternative capitalisation}} removed from non-mainspace redirects. I can appreciate your reasoning here, but I don't think there is a consensus right now to change the way that that template is used. The template documentation has said, for quite a few years now, that it should only be used for mainspace redirects. If there is a consensus to change this usage, then I would agree with your declines, but if it's just you that is opposing it then I don't think that's enough to change the status quo. Also, as you seem quite passionate about changing the usage instructions, I think you should regard yourself as "involved" with that debate, and avoid answering edit requests related to it. There's nothing specifically in policy about this, but I do think that Wbm1058 has a point that it is not a good idea to decline requests that you don't have the permissions to fulfil. If they are obviously frivolous requests then I think declining them would be ok, but I don't regard request to remove {{R from alternative capitalisation}} as frivolous. — Mr. Stradivarius ♪ talk ♪ 14:29, 9 March 2014 (UTC)

Improvement of printworthy display[edit]

Please apply this edit (it includes an edit summary). — Petr Matas 19:34, 1 May 2014 (UTC)

 Additional information needed – Hi, Petr Matas, I tested this and can see no difference. Your es goes "Let {{R yes print}} know, whether we are being embedded in {{This is a redirect}}." How does your edit "let an rcat know" whether (or not?) "we" (who is?) are being embedded specifically in the This is a redirect template, which may or may not be used to categorize redirects? In other words, it is fuzzy and cloudy as to why this edit is needed and what it will do to improve the performance of {{Redirect template}}. Can you elaborate, please? – Paine Ellsworth CLIMAX! 03:07, 3 May 2014 (UTC)
The redirect 1902 glider contains the non-embedded {{R with possibilities}}, which expands to {{Redirect template|...|printworthy=yes}}, whose part currently expands to {{R yes print|embed=yes}}, which expands to "From a printworthy title: ...", which is wrong. In this case, {{R with possibilities}} and in turn {{Redirect template}} is not embedded in {{This is a redirect}}, and therefore the call should be {{R yes print|embed=}}, which will expand to "This is a redirect from...". The {{Redirect template}}'s name parameter can be used to distinguish whether we (i.e. {{Redirect template}}) are being embedded in {{This is a redirect}} and set the {{R yes print}}'s embed parameter accordingly. — Petr Matas 08:22, 3 May 2014 (UTC)
Yes check.svg Done – Paine Ellsworth CLIMAX! 14:47, 3 May 2014 (UTC)

Extract the core into a subtemplate[edit]

Please replace all code of this template from start up to but excluding Printworthiness with {{/core}} and pass all template parameters to it. This will allow us to get rid of the template loop. Petr Matas 18:27, 31 May 2014 (UTC)

We need to pass the parameters using something like this:

{{/core |{{#if:{{{info|}}}|info}}={{{info|}}} }}

It will be nice if we have a template, which will allow to shorten this to

{{/core {{pass-param|info}} }}

Petr Matas 18:53, 31 May 2014 (UTC)

I would normally ask you to make your requested changes to the template's sandbox first; see WP:TESTCASES - but Paine Ellsworth (talk · contribs) seems to be doing something there. Accordingly, I think that the proper response is Red information icon with gradient background.svg Not done: please establish a consensus for this alteration before using the {{edit template-protected}} template. --Redrose64 (talk) 19:11, 31 May 2014 (UTC)

@Paine Ellsworth: I have made the requested changes in the sandbox. After the changes to {{R unprintworthy}} are applied, please apply this edit, where the core of this template is extracted into the subtemplate and {{R yes print}} and {{R no print}} are no longer used. Petr Matas 21:16, 31 May 2014 (UTC)

I think this was already solved, Petr, by simply by merging the code you improved at R yes print and R no print into R printworthy and R unprintworthy, respectively. That action alone will remove the template loop and will turn the first two and their docs (4 pages) into redirects without the need for a /core page. Don't get me wrong, because I have no doubt that your suggested edits to these associated templates will work, I just wonder if more than what was planned is necessary? – Paine Ellsworth CLIMAX! 22:44, 31 May 2014 (UTC)
I also think that no changes should be made until the TfD is closed. – Paine Ellsworth CLIMAX! 22:50, 31 May 2014 (UTC)
I've done a double take, and yours is a superior solution, Petr. Wish I had thought of it! Face-smile.svg – Paine Ellsworth CLIMAX! 23:31, 31 May 2014 (UTC)
To Petr Matas: At this point, I support all you have done except for the code in the sandbox, with which you would like to replace this page. The bottom printworthiness I understand, and that's a good improvement. The top part where you call the /core and follow with several "if" functions is the part that does not seem to me to be necessary. Why does this template page need anything more than to replace the {{R yes print}} and {{R no print}} with {{R printworthy}} and {{R unprintworthy}}, respectively? – Paine Ellsworth CLIMAX! 08:49, 2 June 2014 (UTC)
The idea was to move the code from the main template to /core and transclude /core from the main template. It is to avoid code duplication, which could lead to content forks in the future. The "if" functions are necessary unless someone finds a better way of passing the parameters to /core correctly. Note that the /core contains code like {{{category|[[Category:{{{talk category}}}]]}}}, which will not work (I think) if we pass the parameter using only |category={{{category|}}}. See also my post from 18:53, 31 May 2014 (UTC) above. Petr Matas 09:31, 2 June 2014 (UTC)
Correct: when templates parameters are passed through, they're always present, even if blank. The syntax {{{category|[[Category:{{{talk category}}}]]}}} means "if the |category= parameter is entirely absent, use [[Category:{{{talk category}}}]] but when it is present, use it, even if it is blank". The syntax required for blank and absent to be equivalent is {{#if:{{{category|}}}|{{{category}}}|[[Category:{{{talk category}}}]]}} --Redrose64 (talk) 10:29, 2 June 2014 (UTC)
You probably meant "when parameters are passed through," but thanks for confirming my assumption. Petr Matas 11:18, 2 June 2014 (UTC)
To Redrose64: Within this template are several instances of the [[w:... usage. I remember a previous discussion with you about these. Should they be removed? – Paine Ellsworth CLIMAX! 08:49, 2 June 2014 (UTC)
These are the lines:
-->{{#if:{{{all category|}}}|[[w:Category:{{{all category}}}|{{{name}}}]]|<!--
    -->{{#if:{{{main category|}}}|[[w:Category:{{{main category}}}|{{{name}}}]]|<!--
        -->{{#if:{{{help category|}}}|[[w:Category:{{{help category}}}|{{{name}}}]]|<!--
            -->{{#if:{{{portal category|}}}|[[w:Category:{{{portal category}}}|{{{name}}}]]|<!--
                -->{{#if:{{{talk category|}}}|[[w:Category:{{{talk category}}}|{{{name}}}]]|<!--
                    -->{{#if:{{{template category|}}}|[[w:Category:{{{template category}}}|{{{name}}}]]|<!--
                        -->{{#if:{{{wikipedia category|}}}|[[w:Category:{{{wikipedia category}}}|{{{name}}}]]|<!--
                            -->{{#if:{{{category category|}}}|[[w:Category:{{{category category}}}|{{{name}}}]]|<!--                                -->{{#if:{{{user category|}}}|[[w:Category:{{{user category}}}|{{{name}}}]]|<!--
Here, the w: shouldn't be removed entirely, because that would change a category link into an actual categorisation of the page. The colon needs to be retained; the presence of the w as well means that the category links are treated as interwiki links instead of internal links. I do recall a discussion on the matter, but forget where, or what the details were. IIRC it was something to do with the "what links here" feature: interwiki links don't get listed. --Redrose64 (talk) 10:29, 2 June 2014 (UTC)
I think that treating those as interwiki links is undesirable, so I propose changing "w:" to just ":". Petr Matas 11:26, 2 June 2014 (UTC)
I removed the "w"s from the core template. – Paine Ellsworth CLIMAX! 13:48, 2 June 2014 (UTC)
On a related matter: hiding all those linebreaks inside <!-- --> is largely unnecessary. Linebreaks are whitespace, and whitespace inside parser functions is stripped. --Redrose64 (talk) 10:29, 2 June 2014 (UTC)
I took out the comment tags from inside the "if" functions with this edit, and then had to restore them. Either I did something wrong or the tags are necessary, because their removal appeared to introduce an undesirable "leading space", which when tested on a redirect the individual rcat looked something like this:
* This is a redirect from a title that would be helpful in a printed version of Wikipedia.  For more information follow the category link.
...and when the {{This is a redirect}} template was tried, it looked like:
From a printworthy page title: This is a redirect from a title that would be helpful in a printed version of Wikipedia.  For more information follow the category link.
So removal of the comment tags may not be something we want to do. Unless I did something wrong, of course. – Paine Ellsworth CLIMAX! 13:37, 2 June 2014 (UTC)
Removal of the first pair left a linebreak in place, but that's easily fixed, like this. --Redrose64 (talk) 14:18, 2 June 2014 (UTC)
You're bad! Face-smile.svg – Paine Ellsworth CLIMAX! 14:31, 2 June 2014 (UTC)

──────────────────────────────────────────────────────────────────────────────────────────────────── To Petr Matas: Petr, I tested your change to the core template and it introduced a "leading space" in the same manner as my first edit to rm the comment tags as shown above. I reverted it temporarily because of its usage in {{R printworthy}}. Then I rm'd the core from that template, so now you can experiment and test without affecting anything that's "live". – Paine Ellsworth CLIMAX! 21:56, 2 June 2014 (UTC)

To Paine Ellsworth: Thank you for your thorough testing. Apparently, I forgot to repeat some tests after introducing the last "improvement", which I am undoing here. It seems that links don't like line breaks at all. Petr Matas 03:03, 3 June 2014 (UTC)
Pleasure! – Paine 19:27, 3 June 2014 (UTC)

──────────────────────────────────────────────────────────────────────────────────────────────────── To Petr Matas, Redrose64: Since the discussion about {{R no print}} is just about whether or not to delete it or to redirect it to {{R unprintworthy}}, I went ahead and implemented this edit. Whatever the community decides will no longer affect this template. – Paine Ellsworth CLIMAX! 07:29, 5 June 2014 (UTC)

Template loop error[edit]

The template Template:R from title without diacritics gives an error message on redirect pages using it, such as Stanislaw Lem:

Template loop detected: Template:Redirect template

Since I don't understand where the actual bug is, I am posting this to both Template talk:R from title without diacritics and Template talk:Redirect template. --Ørjan (talk) 10:39, 5 June 2014 (UTC)

It is because the changes to {{R unprintworthy}} have not been applied yet. Redrose64, Paine Ellsworth, please apply them ASAP. Petr Matas 11:10, 5 June 2014 (UTC)
Fixed – Paine Ellsworth CLIMAX! 11:50, 5 June 2014 (UTC)