Template talk:Columns-list

From Wikipedia, the free encyclopedia
Jump to: navigation, search


Hi. First thank you for developing this template. After almost two years searching for an easy columns template on Wikipedia, this is the best hope. Two enhancement requests that would make it usable. Inside list items:

  1. Allow external links
  2. Allow HTML markup

Do you think these are possible? —SusanLesch (talk) 23:20, 3 May 2008 (UTC)

I have the same question. At this moment, the template does not allow you to include links that include "=" in the URL, like for example:
* http://fotogalerien.ch/index.php?gallery=18&lang=2
Can you please fix that? Thanks. —  Ark25  (talk) 11:10, 17 June 2012 (UTC)
I found it. You have use before the list the following: "2=". See for example ro:Berna#Legături externe. —  Ark25  (talk) 11:43, 17 June 2012 (UTC)

Browser display[edit]

Hi, I would also like to thank you for the template. I'm using it in a personal wiki. The problem i'm facing is that i can see the template working fine in Firefox but it doesn't work in Opera and Explorer. It's very weird right? Any idea why is this happening? --Biris (talk) 12:12, 18 December 2008 (UTC)

The template uses CSS to style the columns. It's only supported on Firefox and Safari. Future versions of both Opera and IE should hopefully support it. Chris Cunningham (not at work) - talk 13:22, 18 December 2008 (UTC)

set default to 2[edit]

{{editprotected}} Code in the new sandbox. Sets the default number of columns to be 2, so only one parameter needs to be supplied if one wants two columns. Fully backwards compatible. Chris Cunningham (not at work) - talk 22:08, 10 July 2009 (UTC)

Not done: {{edit protected}} is not required for edits to unprotected pages, or pending changes protected pages. — Martin (MSGJ · talk) 06:29, 11 July 2009 (UTC)
Cascading protection is on, because this is currently a main page transclusion. Re-enabling. Chris Cunningham (not at work) - talk 11:06, 11 July 2009 (UTC)
Not done: {{edit protected}} is not required for edits to unprotected pages, or pending changes protected pages. — Deon555talkI'm BACK! 03:44, 12 July 2009 (UTC)
Symbol comment vote.svg Note: In saying that, the main page transclusion has ended and thus the template is now unprotected. — Deon555talkI'm BACK! 03:45, 12 July 2009 (UTC)


I don't understand exactly what's the use of having this and {{div col}} as separate templates; they seem to do the same, but I might be missing something. If I'm right, though, perhaps it would be a good idea to merge them. --Waldir talk 23:54, 12 March 2010 (UTC)

Even if they both need to remain due to widespread usage or some such reason, a help article or even just a section section that compares and contrasts the two templates would be very, very welcome. Thanks! Geekdiva (talk) 08:20, 25 January 2011 (UTC)
Officially nominated at Wikipedia:Templates_for_discussion/Log/2013_March_31#Template:Columns-list. -- Beland (talk) 23:36, 31 March 2013 (UTC)

Width rather than number[edit]

Is it possible to make it so that the width can be defined rather than the number of columns? For example instead of the number 2, you can type 30em. The code can probably be copied as-is, with only need to change the div classes, from {{Reflist}}. Xeworlebi (talk) 15:42, 1 February 2011 (UTC)

You can use Template:Div col to do this. -- Beland (talk) 23:37, 31 March 2013 (UTC)
Or you can use colwidth=30em. Verbcatcher (talk) 17:59, 19 May 2014 (UTC)

Merged with Div col[edit]

This template is now (semi-)merged with {{Div col}} by formarding all parameters to that template, to avoid duplication of code and functionality. Edokter (talk) — 12:10, 1 December 2013 (UTC)

Bug report[edit]

This template does not show the columnar text, and instead shows the column parameter, if it includes an annotated external link which includes a query string. Example: http://en.wikipedia.org/w/index.php?title=Executive_functions&oldid=616937061#Assessment -- (talk) 17:29, 14 July 2014 (UTC)

correct, if the input has an = sign, you have to either (a) escape the = with {{=}} or (b) just use {{div col}} instead. Frietjes (talk) 18:49, 14 July 2014 (UTC)
Or explicitly number the parameter, like this. It's not a bug in this template, but a feature that is common to all templates that use positional parameters. --Redrose64 (talk) 21:03, 14 July 2014 (UTC)

Problem handling empty contents parameter in template:div_col[edit]

A user recently reported a problem on the help desk using template:columns-list, which caused Chrome to mis-render the page or go into a loop (and never complete the rendering). See discussion here: Village_pump_(technical)#Rendering.2Floop_problem_with_multiple_empty_columns-list_template_on_a_page_in_Chrome

user:Redrose64 at Village Pump identified the specific problem, that template:div_col, when passed an empty contents= parameter, was defaulting to the "normal" form of template:div_col invocation, and not generating the required </div> tag. Basically there were a bunch of instances of:



The problem is apparently because while template:columnslist sees a third parameter, and passes that, it's nothing but whitespace, and as such appears missing in div_col. As near as I can tell that making fixing the problem in div_col difficult. Redrose64 suggested altering this template to not invoke div_col when no list content. This is simpler, and I've done it on a test version of this template at user:rwessel/t8. A sample of usage can be seen at user:rwessel/t6 and user:rwessel/t7 (/t7 is a version with enough entries to cause the loop, /t6 just causes the rendering issue).

Anyway, the basic change was simple enough, I wrapped the body of the template in a test for the list being blank. So now it's:

{{#if:{{{2|{{{1|}}}}}}|{{div col
 | cols = {{{cols|{{{1|}}}}}}
 | colwidth = {{{colwidth|}}}
 | rules = {{{rules|}}}
 | small = {{{small|}}}
 | style = {{{style|}}}
 | content = {{{2|{{{1|}}}}}}

I did an {{error|...}} when the list was empty for lack of better ideas. The alternative is to simply do nothing, which might be appropriate for this template.

Which (finally!) leads me to my two questions: First, shold this just generate no (empty) output if the list is blank, or the {{error}}. And more importantly, I'm a little hesitant to just change a template with 17,000+ transclusions, so if someone can do a bit of a code review, I'd be grateful. Rwessel (talk) 14:53, 25 September 2014 (UTC)

Per WP:TESTCASES, please could you put your proposed changes into the template's sandbox. This will make comparisons easier. --Redrose64 (talk) 15:11, 25 September 2014 (UTC)
Done. I also updated the two test pages I had before (user:rwessel/t6 and user:rwessel/t7) to refer to the sandbox, and added "test 5" to the /testcases page. Rwessel (talk) 15:30, 25 September 2014 (UTC)
I removed some newlines. This is because transclusion works by copying the whole template, then removing from <noinclude> to </noinclude> inclusive, then removing the <includeonly> and </includeonly> tags. This means that any whitespace (newlines included) either side of <includeonly> and </includeonly> is left alone, as is that outside of <noinclude>...</noinclude>.
Also, is the red error message necessary? This may cause some pages to suddenly show an error where none had been shown previously; detecting an empty list and showing nothing (failing gracefully) is probably the better option. --Redrose64 (talk) 16:30, 25 September 2014 (UTC)
As I mentioned, I'm not in love with the error message, although if anyone had an empty list before, it would have caused rendering problems. I don't think an empty table would have any meaningful side effects, so rendering such a thing as null should be fine. Anyway, I've removed it. Rwessel (talk) 16:37, 25 September 2014 (UTC)
I've apparently managed to lose track of this particular issue (Wikipedia really needs something like a to-do list for editors). But assuming there are no objections, I'm going to go ahead an make the above change (I'll give it a few days, just because it has been off the radar for so long). Rwessel (talk) 04:09, 12 January 2015 (UTC)
Let me see if I can simplify it somewhat; I dont like the #ifeq:. -- [[User:Edokter]] {{talk}} 10:23, 12 January 2015 (UTC)
Done. Works equally well with just #if:. -- [[User:Edokter]] {{talk}} 10:32, 12 January 2015 (UTC)

make mobile friendly[edit]

The column count CSS rules should ideally only apply when the browser width is 768px or above (for tablets and higher). On many mobile devices the lists appear cramped and unreadable. Could we thus add media queries in Common.CSS to make this mobile first so these CSS rules do not apply there or reuse existing the div.columns-2 div.columns-3 etc classes? Jdlrobson (talk) 23:35, 11 January 2015 (UTC)

I think this is better discussed at MediaWiki talk:Common.css. This is an old template (and a redirect at that). -- [[User:Edokter]] {{talk}} 00:52, 12 January 2015 (UTC)

with headers[edit]

Rencontres d'Arles has rather messy content (much of which looks as if it has been pasted from fr:Wikipedia), but somebody has put some care into the layout. This breaks down at the head of the columnar content of the section titled "Exhibitions". Simply, this starts with a would-be subheading, but the latter is uninterpreted and instead simply rendered as text within sets of equals signs (subsequent headings are rendered as intended). Tips? -- Hoary (talk) 03:06, 6 March 2015 (UTC)

I suspect some parsing issue, not identifying the beginning of the line correctly. I've made it a bit better, but there's an excessive gap before the first head. Rwessel (talk) 03:47, 6 March 2015 (UTC)
I've gone ahead and changed the columns to template:multicol. It has fewer parsing problems (actually so does template:div col), and allows the break to be made explicit, which is better for this application. It would be better if there were a way to specify that a section should not break, but I don't know of such in wikimarkup, so this will need to be managed manually in the future. Rwessel (talk) 03:58, 6 March 2015 (UTC)
Thank you, Rwessel. It's much better now. (Formatting aside, I really ought to attend to that article, but other commitments will prevent this for a month or longer.) -- Hoary (talk) 04:17, 6 March 2015 (UTC)
@Hoary and Rwessel: In this edit, a &nbsp; was added. If instead the two characters 1= had been added, it would have worked by explicitly numbering the parameter - positional parameters (those not named or explicitly numbered) cannot contain equals signs. --Redrose64 (talk) 14:34, 6 March 2015 (UTC)
Ah, of course. I was thinking it might be something to do with identifying an optional, unnamed, parameter, and I tried explicitly adding the second one, but that didn't do it. Rwessel (talk) 22:40, 6 March 2015 (UTC)

problem with list of external links[edit]

This article Le Monde diplomatique has an excessive list of external links that I tried to get sorted into columns because it's so long, rather than axing it. I tried putting it into three columns but all it does is render the character, "3": see version here. It's a normal asterisked list. Any idea what is going on? Thanks. МандичкаYO 😜 22:04, 6 April 2015 (UTC)

The presence of "=" in the list requires the second parameter to start with "2=". But apart from that, you're better off using {{div col}} instead (for which thsi template is just a wrapper). Also, using a fixed number of columns is not advisable. -- [[User:Edokter]] {{talk}} 22:34, 6 April 2015 (UTC)

Comments in the doc[edit]

@Redrose64 — Regarding the comments in Template:Columns-list/doc, a discussion has been started here. --Nnemo (talk) 09:37, 29 April 2015 (UTC)

That is your user talk page, which is not the place to discuss Template:Documentation/preload. The correct place is its own talk page, which is Template talk:Documentation/preload. That redirects to Template talk:Documentation, which is why in this edit I put "please discuss wording at Template talk:Documentation". --Redrose64 (talk) 09:44, 29 April 2015 (UTC)
A discussion about the contents of the template doc page should be *here*, not on a user page. If it continues, or results in some substantive change to the doc page, please move/copy it here. Rwessel (talk) 09:46, 29 April 2015 (UTC)
@Rwessel: If it were about the doc page specific to this template, that would be true; but the point being made by Gadget850 (talk · contribs) and myself is that there are certain components of a doc page which are common to most other doc pages, because newly-created doc pages normally use Template:Documentation/preload as a framework. The wording in /preload is "Categories below this line, please; interwikis at Wikidata"; and Nnemo seems to want to change that wording by a roundabout route, altering one doc page at a time. --Redrose64 (talk) 15:15, 29 April 2015 (UTC)

Chrome moves link between columns[edit]

An issue has been posted to Wikipedia:Help desk#See Also/Unordered List HTML Element Styling issue. PrimeHunter (talk) 20:04, 2 June 2015 (UTC)

Doesn't work[edit]

This template doesn't seem to work if the list items aren't pure wikilinks. Please make it compatible with regular text. Jujutsuan (Please notify with {{re}} talk | contribs) 12:59, 29 June 2016 (UTC)

Edit: Turns out it's not the non-links, but rather that it apparently can't wrap text to the next line if it goes over roughly 65 characters. When a line is too long it simply displays the second parameter (the number of columns) instead of the content. Jujutsuan (Please notify with {{re}} talk | contribs) 13:10, 29 June 2016 (UTC)
Jujutsuan, do you have some examples? -- [[User:Edokter]] {{talk}} 18:14, 29 June 2016 (UTC)
Now it's making a liar out of me. I just tried a dummy list in this message, but it previewed just fine. I was having trouble over at the "Further reading" section of Evangelical Catholic; I just tried again and it still won't work there. In the meantime I've switched to using {{columns}} there instead, but something's definitely wrong. Jujutsuan (Please notify with {{re}} talk | contribs) 08:34, 30 June 2016 (UTC)
You have have to use |1= because the list contains "=". otherwise, the list doesn't render. (This applies to all templates with unnamed parameters.) -- [[User:Edokter]] {{talk}} 11:03, 30 June 2016 (UTC)
@Edokter: Thank you for your help. That made it work. Best, —Jujutsuan (Please notify with {{re}} talk | contribs) 11:17, 30 June 2016 (UTC)