Template talk:Pagelist

(Redirected from Template talk:Pagelist/testcases)
Latest comment: 9 years ago by SMcCandlish in topic Oxford commas, please

Request to implement editorproof version

edit

{{editprotected}} I recommend to implement the code on {{Pagelist/sandbox}}. See Template_talk:Merge#Problem_when_using_with_templates for the reason, and that I tested this. Debresser (talk) 06:29, 4 October 2009 (UTC)Reply

  Done. Cheers,  Skomorokh, barbarian  07:12, 4 October 2009 (UTC)Reply
I am so proud. Thank you. Debresser (talk) 17:34, 4 October 2009 (UTC)Reply

Version which allows use of multiple namespaces

edit

There's an example of this template at MediaWiki.org with an additional setting allowing you to use each parameter's namespace rather than one standard namespace for all pages: mw:Template:Pagelist --Varnent (talk) 01:13, 7 January 2012 (UTC)Reply

Range support

edit

Hi,

I've added backward-compatible support for beginning and ending ranges: Template:Pagelist/sandboxRange

New parameters:

  • begin - beginning of the page range; defaults to 1
  • end - end of the page range
  • preLink - content to add at the beginning the link; defaults to empty string
  • postLink - content to add at the beginning the link; defaults to empty string

I'm not sure what the page object is about so I don't know if the new preLink/postLink params should tie into that at all, but at least the new code shouldn't break anything. Brettz9 (talk) 13:47, 21 December 2013 (UTC)Reply

Feedback, if not incorporation into the existing template would be most welcome! Brettz9 (talk) 00:48, 3 January 2014 (UTC)Reply

Some improvment

edit

@Mr. Stradivarius: Hi! Maybe some functionality could be added to module? What I mean is to make changes, so it could be used in this kind of templates, where there is something more to the page link. --Edgars2007 (talk/contribs) 06:31, 10 January 2015 (UTC)Reply

@Edgars2007: Sure, go ahead! As long as the existing functionality is kept intact it should be fine. — Mr. Stradivarius ♪ talk ♪ 08:59, 10 January 2015 (UTC)Reply
@Mr. Stradivarius: ha-ha :) Actually, I wanted to know, if you could make those changes, as I'm sure it won't be a problem to you. --Edgars2007 (talk/contribs) 10:48, 10 January 2015 (UTC)Reply

Edit request

edit

Could the default standard for this module to return the namespace of the page it is used on be removed? I'm trying to fix a long-standing issue with Template:Merge, and I think the resolution would be to replace all instances of [[:{{{nspace|{{NAMESPACE}}}}}:{{PAGENAME:{{{NUMBER}}}}}|{{{NUMBER}}}]] with [[:{{{NUMBER}}}]] (if this template weren't Lua-ized), but I have no idea how to do that same task on the Lua module. Steel1943 (talk) 22:34, 26 February 2015 (UTC)Reply

@Steel1943: You would do this. But might this change not break some of the existing transclusions? I don't know why the original template did it that way, but perhaps some pages somewhere are relying on that behaviour. — Mr. Stradivarius ♪ talk ♪ 03:11, 27 February 2015 (UTC)Reply
@Mr. Stradivarius: I was thinking the same. This change would potentially negatively affect all pages that transclude this template that are in any namespace other that the article namespace. However, I noticed that there are about 12000 transclusions, but I noticed that most of them (probably 95% of them) are in the article space. I'm planning on picking through the ones in the non-article spaces here in a few and force the use of the nspace= parameter in them so that this change can happen with no negative effects. Steel1943 (talk) 03:24, 27 February 2015 (UTC)Reply
...And since I now realized that forcing the nspace= parameter is technically impossible (without editing every template that transcludes {{Pagelinks}}), I'm now going to attempt to compile a list of pages (a count) of the amount of pages that could negatively be affected by this change. The only other option would be a three-step process where first, all templates that transclude {{Pagelinks}} are edited to allow the nspace= parameter to be utilized, force the parameter in all transclusions of the template (that are not templates themselves), then perform the edit I requested. But, unless this edit happens, it's technically impossible to list pages from multiple namespaces in this template. Steel1943 (talk) 03:34, 27 February 2015 (UTC)Reply
Actually, at this point, I'm probably going to work on removing/fixing all non-article namespace transclusions. I've been doing so right now, and am actually probably close to being done. I'll update this section when I am done, or run across a complication. Steel1943 (talk) 04:07, 27 February 2015 (UTC)Reply
I'm going to mark this "answered" until I can figure out/fix the non-article space transclusions. (That, and I actually don't want to completely remove the nspace= parameter as my request above is suggesting. I'm going to revisit this after I fix the existing non-article space transclusions.) Steel1943 (talk) 04:25, 27 February 2015 (UTC)Reply

Oxford commas, please

edit

This template prints the last two article names separated by " and ". It would be helpful to use ", and " instead. The main reason is that "and" is often a word within an article name, so failure to set off the conjunction with a comma can confuse readers by implying that the last two names are a single article name. Link coloring is not always a sufficient visual cue.

Example: {{Pagelist|nspace=w|Frick and Frack|Mutt and Jeff|Madonna|Child}}

Current output: Frick and Frack, Mutt and Jeff, Madonna and Child.

Desired output: Frick and Frack, Mutt and Jeff, Madonna, and Child.

Please consider implementing this as an option rather than a change to default behavior, because lists with only two items should not be separated by commas. This change should not break any existing usage. — ob C. alias ALAROB 14:47, 7 April 2015 (UTC)Reply

You can use |conjunction=:
{{Pagelist|nspace=w|conjunction=, and |Frick and Frack|Mutt and Jeff|Madonna|Child}}.
Frick and Frack, Mutt and Jeff, Madonna, and Child. Alakzi (talk) 15:10, 7 April 2015 (UTC)Reply
Thanks, Alakzi. — ob C. alias ALAROB 15:36, 7 April 2015 (UTC)Reply
I see that the conjunction parameter already existed and I overlooked the guidance in Help. I did read it before making the request, but apprently I didn’t comprehend it.
I find that I have to add a non-breaking space after ", and " because a space will be ignored, as here:
{{pagelist |nspace=w|conjunction=, and |Muslim population growth|Ali|The Conversation of Eiros and Charmion}}
Muslim population growth, Ali, andThe Conversation of Eiros and Charmion
Same thing happens if I paste your demo:
{{Pagelist|nspace=w|conjunction=, and |Frick and Frack|Mutt and Jeff|Madonna|Child}}.
Frick and Frack, Mutt and Jeff, Madonna, andChild.
But this works: {{Pagelist|nspace=w|conjunction=, and&nbsp;|Frick and Frack|Mutt and Jeff|Madonna|Child}}</nowiki>
Why are you and I getting different results? — ob C. alias ALAROB 16:00, 7 April 2015 (UTC)Reply
We're not; I used alt-space to type a non-breaking space because it's quicker. It gets copied as a regular space. Apologies for the confusion. Alakzi (talk) 16:05, 7 April 2015 (UTC)Reply
To add, there's no workaround for this—that I know of; leading and trailing whitespace inside parameters always gets stripped. Alakzi (talk) 16:09, 7 April 2015 (UTC)Reply
OK. That did the trick. Thanks. — ob C. alias ALAROB 16:32, 7 April 2015 (UTC)Reply
This didn't really resolve the issue. See next thread.  — SMcCandlish ¢ ≽ʌⱷ҅ʌ≼  03:41, 8 November 2015 (UTC)Reply

Serial comma default when 3+ list items

edit

This should use the serial (a.k.a. Oxford) comma by default when there are three or more items. This often produces difficult-to-parse output because of the lack of this comma, and virtually no one is going to manually inject one with a special parameter. Even American style guides like Chicago Manual of Style recommend the use of a serial comma in any case where it aids comprehension, so its use is not "against the rules" anywhere. The |conjunction= parameter is of broken utility anyway, since it will also insert a comma before "and" when there are only two items, which is almost never desirable (only when the two items are complex and contain their own punuctation, in which case a semicolon is often better anyway).  — SMcCandlish ¢ ≽ʌⱷ҅ʌ≼