Jump to content

Template talk:Flatlist

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Need to be able to set the delimiter character(s)

[edit]

The '|' looks ugly. I'm told over at User talk:Pigsonthewing that this template makes pages easier for assistive software for the blind, but unless it looks nicer for those of us that can see, I won't like it when all of my templates are converted to use it. DavidRF (talk) 16:11, 29 August 2008 (UTC)[reply]

Please tell us, which are your templates? Andy Mabbett | Talk to Andy Mabbett 16:43, 29 August 2008 (UTC)[reply]
Sorry for the use of the 'my' word. I'm on vacation and don't time to choose my words wisely. Its just frustrating to make a page or template and have someone from a completely different section of wikipedia to completely change its look and feel without consulting the editors in that particular area first. I actually asked User talk:Pigsonthewing if it was OK to revert the changes and he didn't respond to me. Then he just reverts the reverts of people who didn't like the change.
I do think customizing the delimiter character is a constructive suggestion. The more customizable the template is, the more likely people will be OK with adopting it.DavidRF (talk) 00:24, 30 August 2008 (UTC)[reply]
Your comment above is factually inaccurate in more than one regard: (1) I responded to you on my talk page. (2) The only revert I made was in response to another editor's revert of my initial edit, which gave no reason in its edit summary; as I said in my edit summary. You then reverted me, and gave a reason. Though I did not agree with your reason, and though your reason included a false and unacceptable accusation that I was spamming, I did not revert again. Andy Mabbett | Talk to Andy Mabbett 07:49, 30 August 2008 (UTC)[reply]
OK, sorry. I didn't realize that Andy Mabbett and Pigsonthewing are the same person. I'm just noticing the redirects in edit mode. DavidRF (talk) 15:15, 30 August 2008 (UTC)[reply]

Excellent idea in general. I've similar concerns about the |-border separator, though. Detailed comments left at Wikipedia talk:Accessibility#Horizontal lists. :) -- Quiddity (talk) 17:15, 29 August 2008 (UTC)[reply]

Also raised at Wikipedia talk:WikiProject Lists#template:flatlist. -- Quiddity (talk) 20:06, 22 January 2009 (UTC)[reply]

I just checked the ref (and a ref from there). Basically this seems to be unresolved. This list would really be handy (because it would be easy to convert and easy to maintain) if I could specify comma as the delimiter. then we could put lists in narrative and have them appear as part of the narrative than as lists, but be able to maintain them more easily as lists. Spacing might be different for different delimiters. BTW, I love this in navboxes. I understand that this is better for accessibility as well (which is great), but personally I think it will be easier to maintain too. Don Lammers (talk) 01:25, 12 September 2011 (UTC)[reply]

Horizontal lists in navboxes

[edit]

Many thousands of Wikipedia articles have navboxes, in which lists of links are presented, horizontally, without using list mark-up, but instead using {{·}} or suchlike as a kludge. This is semantically poor and has implications for accessibility.

I created {{Flatlist}} in an attempt to begin addressing this, but previous discussion (two-and-a-half years ago) petered out before various concerns were resolved. Now that CSS an browsers have moved on, I'd like us to find a solution. Please contribute to centralised discussion on MoS (accessibility). Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 14:02, 28 March 2011 (UTC)[reply]

Nested lists

[edit]

Nested lists are present in many navboxs where we aim to use Template:Flatlist, like Template:Intel processors‎. And currently, this template can't make nested flatlists.

Working example

[edit]

Here is an example of a nested flatlist. Don't look at the "-" separators, it's only for convenience as I can't do the bullet styling with inline code.

Code:

<ul>
<li style="display:inline;">bearded cat -</li>
<li style="display:inline;">tiny cat -</li>
<li style="display:inline;">fat cats
<ul style="display:inline;">
<li style="display:inline;">([[lion]] -</li>
<li style="display:inline;">[[leopard]]) -</li>
</ul></li>
<li style="display:inline;">playful cat</li>
</ul>

Result:

  • bearded cat -
  • tiny cat -
  • fat cats
  • playful cat

Why this template fails

[edit]

Here is the code that should produce a nested list, but does not :

{{flatlist}}
*[[cat]]
*[[dog]]
*[[horse]]
{{flatlist}}
*big horse
*little horse
*snot-nosed horse
*loyal horse
{{endflatlist}}
*[[cow]]
*[[sheep]]
*[[pig]]
{{endflatlist}}

the result is broken:

  • big horse
  • little horse
  • snot-nosed horse
  • loyal horse

Because the MediaWiki parser produces the following HTML:

<div class="hlist" style="margin-left:0em;">
<ul>
<li><a href="/wiki/Cat" title="Cat">cat</a></li>
<li><a href="/wiki/Dog" title="Dog">dog</a></li>
<li><a href="/wiki/Horse" title="Horse">horse</a></li>
</ul>
<div class="hlist" style="margin-left:0em;">
<ul>
<li>big horse</li>
<li>little horse</li>
<li>snot-nosed horse</li>
<li>loyal horse</li>
</ul>
</div>
<ul>
<li><a href="/wiki/Cow" title="Cow" class="mw-redirect">cow</a></li>
<li><a href="/wiki/Sheep" title="Sheep">sheep</a></li>
<li><a href="/wiki/Pig" title="Pig">pig</a></li>
</ul>
</div>

That's because we are mixing wiki syntax and html-like DIVs. Before opening a new DIV, MediaWiki closes the previous UL. This kind of behavior is usual, it does the same with several other kinds of syntax. It probably has it good sides. We're probably at fault for not using a SPAN, or not styling the UL itself. Cheers, Dodoïste (talk) 15:45, 7 May 2011 (UTC)[reply]

That's HTMLtidy doing it's work. I tested it with span, but that really threw tidy into a fit. Begs the question... Why would we want to nest horizontal lists anyway? That seems rather pointless. Edokter (talk) — 17:12, 7 May 2011 (UTC)[reply]
Well, I' don't like it either personnally. I find its visual structure to be confusing. But I don't believe we will be able to tell that many editors to change their habits, now, will we?
Hmm. I've just tried to apply the class="hlist to the UL element, and the problem seems to be elsewhere. The code I used:
<ul class="hlist">
*[[cat]]
*[[dog]]
*[[horse]]
**[[dog]]
**[[horse]]
*[[cow]]
</ul>

result:

HTML code produced:

<div style="margin-left: 2em" class="hlist">
<ul>
<li><a href="/wiki/Cat" title="Cat">cat</a></li>
<li><a href="/wiki/Dog" title="Dog">dog</a></li>
<li><a href="/wiki/Horse" title="Horse">horse</a>
<ul>
<li><a href="/wiki/Dog" title="Dog">dog</a></li>
<li><a href="/wiki/Horse" title="Horse">horse</a></li>
</ul>
</li>
<li><a href="/wiki/Cow" title="Cow" class="mw-redirect">cow</a></li>
<li><a href="/wiki/Sheep" title="Sheep">sheep</a></li>
<li><a href="/wiki/Pig" title="Pig">pig</a></li>
</ul>
</div>

Why was the ul class="hlist" replaced by div class="hlist" and an UL? And why is it not displayed inline, unlike the previous similar example (except for the enclosing DIV). There's something fishy here. Dodoïste (talk)

As I siad above; that's HTMLtidy trying to correct what it thinks is impossible HTML, so it throws the order of the HTML elements until it thinks it's 'legal'. I think we have to accept that nested horizontal lists are not possible. Edokter (talk) — 20:16, 7 May 2011 (UTC)[reply]

Nested list, again

[edit]

I tried to do this, and it's not working. Templates like template:First World War treaties:

have parentheticals in them, and this would be an ideal use of nested lists. Not sure about the nested flatlist invocations offered above; I was thinking the two-stars approach, and would like it to produce the same look as the example template, with the lists nested in the page readers get. Be nice if this worked:

{{flatlist |
* [[Treaty of Rapallo (1920)|Rapallo (1920)]]
* [[Treaty of Alexandropol|Alexandropol]]
* [[Treaty of Moscow (1921)|Moscow]]
* [[Cilicia Peace Treaty|Cilicia]]
* [[Treaty of Ankara (1921)|Ankara]]
* [[Treaty of Kars|Kars]]
* [[Treaty of Lausanne|Lausanne]]
* [[Treaty of Rapallo (1922)|Rapallo (1922)]]
* Montreux Conventions
**([[Montreux Convention Regarding the Regime of the Turkish Straits|Regime of the Turkish Straits]]
** [[Montreux Convention Regarding the Abolition of the Capitulations in Egypt|Abolition of the Capitulations in Egypt]])
* [[Agreement between the Allied and Associated Powers with Regard to the Contribution to the Cost of Liberation of the Territories of the Former Austro-Hungarian Monarchy|Territories of the Former Austro-Hungarian Monarchy]]
* [[Agreement Between the Allied and Associated Powers with Regard to the Italian Reparation Payments|Italian Reparation Payments]]
* British Capitulations in Egypt
**([[Agreement between Great Britain and Denmark Relating to the Suppression of the Capitulations in Egypt (1921)|Denmark]]
** [[Agreement between Great Britain and Greece Relating to the Suppression of the Capitulations in Egypt (1920)|Greece]]
** [[Agreement between Great Britain and Norway Relating to the Suppression of the Capitulations in Egypt (1921)|Norway]]
** [[Agreement between Great Britain and Sweden Relating to the Suppression of the Capitulations in Egypt (1921)|Sweden]]
** [[Agreement between Great Britain and Portugal Relating to the Suppression of the Capitulations in Egypt (1920)|Portugal]])
* [[Agreement Regarding the Restoration of the State of Peace between Germany and China (1921)|Sino-German Peace Treaty]]
}}

 —Portuguese Man o' War 05:09, 16 September 2011 (UTC)[reply]

Uh, this mostly fixes this. The code:

.hlist li ul { display: inline; }

makes the nested ul be inline, so things don't drop down. The dots are off a little bit, though, but that could be tweaked. And it would be nice to use a slightly larger dot. Might want to add some bit of padding to the navbox list cells, so they don't blend together, too.  —Portuguese Man o' War 05:25, 16 September 2011 (UTC)[reply]

Viewing problems

[edit]

A discussion on problems with viewing flatlist is underway at Template talk:Navbox#Flatlist problems for anyone interested/able to help. Number 57 22:18, 1 October 2011 (UTC)[reply]

Wrapping

[edit]

Is there some nice way to avoid wrapping inside the items when using this template? In the old-style lists, I would do this by using {{nowrap begin}}, {{nowrap end}} and {{•wrap}}. How can I achieve similar effect? — Preceding unsigned comment added by Svick (talkcontribs) 14:56, 18 March 2012 (UTC)[reply]

Archive 1 (2006) • Archive 2 (2007) •
Archive 3 (2008) • Archive 4 (2008–9) •
Archive 5 (2010) • Archive 6 (2010–11)
is that what you see? are you asking to have the bullets at the start of each line, rather than at the end of each line? Frietjes (talk) 16:42, 19 March 2012 (UTC)[reply]
you could do this and just remove the trailing bullets. Frietjes (talk) 16:44, 19 March 2012 (UTC)[reply]
Well, that's not what I see. I'd like to look it exactly the way you see it. User<Svick>.Talk(); 18:55, 24 March 2012 (UTC)[reply]
what I see is basically what I have in put up above. I suppose if you really wanted to force nowrap, you could just put a {{nowrap}} around each entry. it seems this is an IE problem, as pointed out by Edokter. Frietjes (talk) 16:46, 25 March 2012 (UTC)[reply]

The proper title of this template would be Template:Flat list, wouldn't it? "Flatlist" isn't a word. --MZMcBride (talk) 19:47, 11 April 2012 (UTC)[reply]

So is "nowrap". I think the meaning is clear. Keep it simple. Edokter (talk) — 17:46, 13 April 2012 (UTC)[reply]
And "navbox". I've seen a lot of page moves in the past few years moving pages to clearer (more proper) English titles, but keeping the redirects in place, obviously. In my mind, there's a distinction between "nowrap" or "navbox" and "flatlist". Maybe there shouldn't be, but there is.
One might argue that using two words is clearer to users. Sometimes people have difficulty separating "flatlist" into "flat list" in their head, particularly if English isn't their native language. In any case, I'll continue to use the Template:Flat list redirect, but I do think moving the page at some point would be a good idea. --MZMcBride (talk) 14:18, 14 April 2012 (UTC)[reply]
"Flatlist" is a list that is flat; I consider it one word. Edokter (talk) — 16:13, 24 November 2012 (UTC)[reply]

Centering

[edit]

There is a pretty bad aspect to this template in that somehow it is impossible to center the text in it, and I cannot figure why. Clearly this is because the template generates a div around a ul insted of a direct ul that could be styled, but I cannot quite tell where the CSS that lines the ul to the left comes from that cannot be superceded (I do not have access to advanced tools on this computer). Circéus (talk) 22:51, 17 May 2012 (UTC)[reply]

  • Item 1
  • Item 2
can you provide an example of what you are trying to accomplish? The list above is centered? Frietjes (talk) 15:38, 18 May 2012 (UTC)[reply]

Try to get that inside a table:

  • Item 1
  • Item 2

Circéus (talk) 17:24, 18 May 2012 (UTC)[reply]

It looks like it is a problem with the wikitable class, since this
  • Item 1
  • Item 2

and this

  • Item 1
  • Item 2

and this

work. Frietjes (talk) 17:38, 18 May 2012 (UTC)[reply]

the problem is indeed in MediaWiki:Common.css, look for this chunk of code
/* lists in data cells are always left-aligned */
.wikitable td ul,
.wikitable td ol,
.wikitable td dl {
    /* @noflip */
    text-align: left;
}
a work around would be to use something other than the wikitable class, or to use
{| class="wikitable" style="width:30em;"
|-
| class="hlist" |
<ul style="text-align:center">
<li>Item 1
<li>Item 2
</ul>
|}
which is somewhat ugly. Frietjes (talk) 17:44, 18 May 2012 (UTC)[reply]
I asked for some help at MediaWiki talk:Common.css#Centering an hlist in a wikitable. Frietjes (talk) 17:55, 18 May 2012 (UTC)[reply]

Syntax and template's name

[edit]

Hello. Is there a way to use this template in a more compact fashion, e.g.

{{flatlist |[[Russia]] |[[Finland]] |[[Poland]] |[[Estonia]] |[[Latvia]] |[[Lithuania]] |[[Belarus]] |[[Moldova]] |[[Ukraine]] |[[Georgia]] |[[Armenia]] |[[Azerbaijan]] |[[Kazakhstan]] |[[Uzbekistan]] |[[Turkmenistan]] |[[Kyrgyzstan]] |[[Tajikistan]]}}

rather than the space-consuming

{{flatlist |
* [[Russia]]
* [[Finland]]
* [[Poland]]
* [[Estonia]]
* [[Latvia]]
* [[Lithuania]]
* [[Belarus]]
* [[Moldova]]
* [[Ukraine]]
* [[Georgia]]
* [[Armenia]]
* [[Azerbaijan]]
* [[Kazakhstan]]
* [[Uzbekistan]]
* [[Turkmenistan]]
* [[Kyrgyzstan]]
* [[Tajikistan]]
}}

...?

Also, for me, the name "Flatlist" doesn't quite capture this template's nature. How about "Dotlist", "Dottedlist" or maybe something like "Stringlist" or "Itemstring"?

213.246.91.158 (talk) 11:59, 24 November 2012 (UTC)[reply]

No, there isn't. I don't see the benefit either; editing wikilists is much easier than having to cram the entire list in one line. As for the name, the teplate uses CSS to create a "horizontal list", which is another word for 'flat'. Edokter (talk) — 14:17, 24 November 2012 (UTC)[reply]
I guess "craminess"(?) is in the eye of the beholder. It'd certainly looked crammed in the article, but this the article's code – and, in this case, information that will (should) remain unchanged. Thanks for the "horizontal list = flat" info. Since the list uses dots rather than commas, etc, how about "Flatdotlist"? 213.246.91.158 (talk) 14:56, 24 November 2012 (UTC)[reply]
Or perhaps an option to use commas, so it isn't just a "flatdotlist". It's much easier to create and maintain a list this way, and if we could include it as part of narrative rather than having to write things out when they are in narrative, Or be able to easily take a list and make it part of the narrative (a comma separated horizontal list that has "and" before the last item), that would be great.
If you want to maintain your lists horizontally, just skip the template markup and use the symbol · instead of upright bars. This avoids template overhead and template markup, so it's even more compact than your example above. Don Lammers (talk) 15:58, 24 November 2012 (UTC)[reply]
That defeats the purpose of this template; to create a horizontal list with the proper sematic markup in order to maintain maximum accessability. Manually inserting dots or bars is a thing of the past now; we do not want to go back to that. Edokter (talk) — 16:07, 24 November 2012 (UTC)[reply]
First, I always use this template, as it is far more convenient. However, I had not heard that use of this template was mandatory (if it is, it sure wasn't evangelized very well). I started using it because someone replaced lists in some templates I work with (without leaving notes), and I found it far more convenient (I can easily copy from a vertical list in a list article to a horizontal list in a navbox with very few changes). I do, however, maintain a lot of "embedded" lists in the narrative, and I sure wish I could use this template (or a similar template) for that as well. Don Lammers (talk) 16:30, 24 November 2012 (UTC)[reply]
'Mandatory' may be a big word, but when hlist was introduced, most navboxes were converted with a link to WP:HLIST in the edit description, explaining the reasoning behind it. Edokter (talk) — 16:37, 24 November 2012 (UTC)[reply]
I agree that accessibility should be a priority (if not the priority), but I've realized there are occasions (such as when something won't or shouldn't be changed) where a compact syntax for flatlist, plainlist, etc, is desirable. I imagine that's also what Don has in mind. 213.246.91.158 (talk) 16:40, 24 November 2012 (UTC)[reply]
for {{plainlist}}, there is a one-line version, use {{unbulleted list}}, which is equivalent in terms of the end result. I could see a use for a similar version of this template, since it does not work with image captions. Frietjes (talk) 17:47, 26 November 2012 (UTC)[reply]
a total hack, but {{flatlist|{{ubl|A|B|C|D|E}}}} works. Frietjes (talk) 00:10, 4 December 2012 (UTC)[reply]
That's brilliant; thanks! 213.246.94.204 (talk) 07:39, 9 December 2012 (UTC)[reply]

Template deletion

[edit]

Please someone help me to make them delete this horrible template, i can't with this. --ImtheNeonLight (talk) 21:59, 24 May 2013 (UTC)[reply]

User is now indef blocked. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 12:47, 4 October 2013 (UTC)[reply]

Accessibility

[edit]

Can someone in the know who understands syntax mark-up explain exactly how/why this is more accessible? I think I understand the general principles of the template and I personally am an avid user of it but what's holding us back from implementing elsewhere is essentially the following things:

  1. Users not willing to accept accessibility as a valid article improvement.
  2. Users claiming that mid-dots ( · ) are not grammatically correct.
  3. Users refuting the use of an accessible template because a particular project hasn't had a consensus that it wishes to adopt {{flat list}} even though its widely advocated as more accessible.

If someone could aid me with providing a better explanation I can better advocate the use of this template. → Lil-℧niquԐ 1 - { Talk } - 22:42, 21 August 2013 (UTC)[reply]

It makes proper HTML lists that screen readers can process and interact with. For example, a user of JAWS, and other screen readers that use similar principles, can move to the list by pressing "L" until they find it and move between items with "I" and "shift-I" (going forward and back, respectively). Graham87 01:52, 23 August 2013 (UTC)[reply]
1. As Graham says, the improvement to the article is principally for those who use assistive technology to 'read' our articles. They can hear and navigate a proper list without hearing "dot" between each item for example. I wouldn't recommend using it in running prose, of course, as anyone using a screen reader won't have a problem with hearing "He went into the exam carrying a pen, pencil, ruler and compass" and most editors will complain if we wrote "He went into the exam carrying
  • a pen
  • pencil
  • ruler
  • compass
"
. On the other hand, something like a navigation template is dramatically improved in accessibilty by being re-written using {{flatlist}}.
2. If we don't use it in running prose, then there's nothing grammatical to consider in the visual presentation of mid-dots. It's precisely equivalent to having bullet-points at the start of each line of a vertical list – neither the bullets nor the dots actually exist in the html; they are just an artefact of the way that your browser interprets the style, and a screen reader does not hear them.
3. The only thing you can do with WikiProjects is to keep on explaining and educating them. Ask them to consider how a screen reader would hear what they are using. There is a project-wide consensus that the guidance at WP:ACCESS applies to all articles, and a local consensus at a particular project cannot override that. Nevertheless it's best not to use that argument as we need to coax WikiProjects into accepting accessibility as a natural part of building an encyclopedia that's available for everyone, not as something that is imposed on them from outside their area of expertise.
I can only suggest that you keep spreading the word and keep up the good work! --RexxS (talk) 13:19, 23 August 2013 (UTC)[reply]

Formatting of nested lists in navboxes

[edit]

I'm trying to use nested lists in a navbox like this (see User:Gazibara/sandbox#References). The second list (the one under Subtraction) is a true nested list, while the first is not. I am dissatisfied by both looks. In fact, I would like to have something like:

Integer: ADD • ADC • ADCX • ADOX; Floating-point: FADD • FADDP; Mixed: FIADD

I can do it without a list (as I did it above), I can do it in HTML using nested lists and CSS, but I want to do it using wiki markup without user CSS. Any ideas? Gazibara (talk) 11:22, 12 November 2014 (UTC)[reply]

Try using the wikimarkup for a definition list. -- [[User:Edokter]] {{talk}} 12:33, 12 November 2014 (UTC)[reply]
Integer
ADD
ADC
ADX
ADOX
Floating-point
FADD
FADDP
Mixed
FIADD
Gazibara, to be clear, you are dissatisfied with the bullets between "ADOX" and "floating-point" and and between "FADDP" and "Mixed" and would rather they were semicolons? Frietjes (talk) 20:52, 13 November 2014 (UTC)[reply]
See this version of the looks he doesn't like. -- [[User:Edokter]] {{talk}} 21:26, 13 November 2014 (UTC)[reply]
Frietjes, after I tried using definition list instead of unordered list, I got a far better result, as you can see from the current version. It would be nice to replace the bullet before the bold text with a semi-colon or some other visually different symbol (e.g. a fatter bullet or ⁘ (U+2058) or ※ (U+203B)), but it's nice as it is as well. Gazibara (talk) 07:51, 14 November 2014 (UTC)[reply]
okay, thanks for the update. a different delimiter is possible, but would be fairly complicated to implement, and probably not worth the effort at this point. Frietjes (talk) 18:08, 14 November 2014 (UTC)[reply]

This template on cywiki

[edit]

This template doesn't work on the Welsh Wikipedia, though the code is the same as on the English (as is the documentation). What's missing from cy.wikipedia.org? Ham (talk) 13:49, 28 November 2014 (UTC)[reply]

Ham, check MediaWiki:Common.css vs. cy:MediaWiki:Common.css. in particular search for ".hlist" in the one here, and copy all those sections over to the Welsh WP. Frietjes (talk) 15:29, 28 November 2014 (UTC)[reply]
Ham, there is also some javascript in MediaWiki:Common.js that you probably want as well (fixes a trailing dot issue). Frietjes (talk) 15:32, 28 November 2014 (UTC)[reply]
(edit conflict) @Ham: It's not the template; the problem is that cy:MediaWici:Common.css has no rules concerning the hlist class. It may be possible to copy them from MediaWiki:Common.css. You'll need administrator rights to do that; Llywelyn2000 (talk · contribs) (cy:Sgwrs Defnyddiwr:Llywelyn2000) should be a good one to ask. --Redrose64 (talk) 15:34, 28 November 2014 (UTC)[reply]
Brilliant, quick response! Thanks to all of you; yes both css files were over two and a half years old, cob-webed and very dusty! We need a tool to copy automatically! Llywelyn2000 (talk) 22:36, 28 November 2014 (UTC)[reply]

Un-named parameter check

[edit]

{{Chemical agents sidebar}} was misbehaving, displaying the passed CSS style parameters rather than implementing them (see [1], click on [show] for "Nerve"). Maybe an un-named positional parameter {{flatlist|CSS style string}} used to work? Now it is apparently only accepted as a named parameter {{flatlist|style=CSS style string}}. Easy enough to fix[2] but I wonder how many other invocations need that too. Can we create a maintenance category something like {{#if: {{{1|}}} |[[Category:Flatlist misuse]]}} to track them down? DMacks (talk) 06:12, 28 April 2015 (UTC)[reply]

It has never accepted |style= as an unnamed parameter, and as far as I can tell, no template ever has; it is always explicitly named. The first unnamed parameter, if present, is usually used to pass content. -- [[User:Edokter]] {{talk}} 08:41, 28 April 2015 (UTC)[reply]
IIRC this was because some years ago a forked template was created that took the list as the second parameter (instead of the first), and as you say, took the style info as the first; this forked template was later merged back in. I thought we fixed up all the usage; maybe somebody thought that the forked template still existed and didn't preview before saving. I'll need to dig around to be sure. --Redrose64 (talk) 09:06, 28 April 2015 (UTC)[reply]
Got it. It was a Sardanaphalus hack-up from just over a year ago, see Template:Startflatlist and Template:Startplainlist. --Redrose64 (talk) 09:54, 28 April 2015 (UTC)[reply]
Wow, what a deep mess. I guess I'll just make a mental note in case I see it visible again. DMacks (talk) 14:19, 28 April 2015 (UTC)[reply]
He created hundreds of such template 'redirects' and managed to get some of them transcluded in 1000s of articles. I'm still cleaning up after him. He is template-banned now, so if you see any template-related edits of his, just revert them. I'll deal with the mess. -- [[User:Edokter]] {{talk}} 14:26, 28 April 2015 (UTC)[reply]

Problem with extra bullet point

[edit]

Everywhere I see this template in use, there's an added bullet point that follows the last item in each list. However, I'm certain this bullet wasn't there a few days ago. What happened, and can it be changed back? User:SubZeroSilver (talk) 19:20, 10 October 2017 (UTC)[reply]

It has been fixed. Thank you. User:SubZeroSilver (talk) 13:12, 11 October 2017 (UTC)[reply]
Wikipedia:Village pump (technical)#Navbox templates / hlist issue? is related. --Redrose64 🌹 (talk) 15:09, 11 October 2017 (UTC)[reply]

Template-protected edit request on 30 October 2017

[edit]

Hi, could the html markup in this template be fixed? See https://wiki.riteme.site/w/index.php?title=Template:Flatlist/sandbox&oldid=807871376 for a correct fix where the div is closed outside the if section instead of adding an extra closing div in the noinclude section.

Tholme (talk) 15:54, 30 October 2017 (UTC)[reply]

@Tholme: I'm not sure your change is correct. When used without parameters, typically using the redirect {{startflatlist}}, the template is required to leave the div open so that the end of the list can be marked with {{endflatlist}}. -- John of Reading (talk) 17:09, 30 October 2017 (UTC)[reply]
You are right, so don't do the change. Tholme (talk) 17:35, 30 October 2017 (UTC)[reply]

Display issue on mobile version

[edit]

Raised Wikipedia:Village pump (technical)#Template:Flatlist does not display correctly on mobile in case if anyone is not aware. ネイ (talk) 16:45, 24 May 2020 (UTC)[reply]

I added the class hlist-separated, which is present in {{hlist}} and appears to make bullets render in mobile. Report any bugs here. – Jonesey95 (talk) 17:57, 24 May 2020 (UTC)[reply]
@Jonesey95: Nested flatlists do not display closing parentheses on mobile; see for example "People or cargo transported" in the infobox at Atlas V. I get the same issue with {{hlist}}, I'm guessing because they use the same class. @ネイ: I redirected the link in your comment to the archive. Hairy Dude (talk) 14:44, 20 February 2022 (UTC)[reply]
I don't know if second-level asterisks are formally supported in this template. I have added a case to the testcases, showing that there are missing closing parens after "Curiosity" and "Quasar" in mobile view. – Jonesey95 (talk) 18:25, 20 February 2022 (UTC)[reply]
One note: Removing "hlist-separated" from the class declaration removes the bullets and restores the closing parens. See the sandbox version in the mobile testcases link above. – Jonesey95 (talk) 23:16, 20 February 2022 (UTC)[reply]
li:after is different in MediaWiki:Mobile.css than what is in MediaWiki:Common.css. -- WOSlinker (talk) 23:54, 20 February 2022 (UTC)[reply]
I don't know why it's like this or why it's important. Sigh. Yes, that would be the issue. Izno (talk) 00:14, 21 February 2022 (UTC)[reply]
The relevant task is probably phab:T174399. Izno (talk) 00:15, 21 February 2022 (UTC)[reply]
Izno, based on the age of these phab tickets (see also the ill-fated T169315), it looks like we are on our own. Would it help to have a custom styles.css file for this template? – Jonesey95 (talk) 00:23, 21 February 2022 (UTC)[reply]
Yes, but that's after MediaWiki talk:Common.css/to do#Hlist is done. I haven't laid out everything that needs to happen there yet, but getting that 5k listed down to false positives would be a good start. Izno (talk) 00:50, 21 February 2022 (UTC)[reply]
Izno, that 5k list is only 1k if you ignore the Wikipedia:Main Page history subpages (or treat them as a separate set). -- WOSlinker (talk) 15:27, 22 February 2022 (UTC)[reply]
As I said, haven't done a lot of work with the hlist case. If that knocks out 4k, that works for me. Feel free to leave a link in the working section with the refined search. Izno (talk) 18:05, 22 February 2022 (UTC)[reply]
I've fixed this in mobile.css. We'll probably have to refix it when we get around to deploying the TemplateStyles version because when we do I want to review what hlist-separated is actually doing. Izno (talk) 22:43, 6 March 2022 (UTC)[reply]
For the record, this edit shows the current workaround for this goofiness. – Jonesey95 (talk) 02:40, 7 March 2022 (UTC)[reply]

Why the extra closing tag?

[edit]

Is there a purpose for the seemingly stripped </div> after the <noinclude>? —Anomalocaris (talk) 22:59, 22 December 2020 (UTC)[reply]

I think it's because there is no |1= in the template page itself. When you say "seemingly stripped", what do you mean? To me, it appears to match the opening tag just fine, but it is needed only on this page (hence the noinclude tag). Is that closing tag causing an error somewhere? – Jonesey95 (talk) 00:18, 23 December 2020 (UTC)[reply]
I see </div> just before }} and then another one inside </div><noinclude>...</noinclude>, which, to my naive eye, seems to be stripped. I think you were trying to explain this to me above, so maybe you'll have to explain it at a more basic level, since I don't know why I should care about |1=. Anomalocaris (talk) 23:14, 28 December 2020 (UTC)[reply]
The template may be used in two differing ways: (i) like the first example at Template:Flatlist#Examples, where the entire list is passed into {{flatlist}} through its |1= parameter; (ii) like the example at Template:Flatlist#Alternative syntax, where the list is placed between {{startflatlist}} and {{endflatlist}}. In the case of (i), the single use of {{flatlist}} wraps the list in <div class="hlist hlist-separated">...</div>, which is a balanced tag pair; in the case of (ii), the {{startflatlist}} produces an unclosed <div class="hlist hlist-separated"> tag, and this is closed by the {{endflatlist}} which produces the balancing </div> tag (and nothing else). Now Template:Startflatlist is merely a redirect to Template:Flatlist, so the second example may be written
{{flatlist}}
* [[cat]]
* [[dog]]
* [[horse]]
* [[cow]]
* [[sheep]]
* [[pig]]
</div>
and this shows that when {{flatlist}} is used without parameters, some form of explicit closure is required, which is why there is that </div> after the <noinclude>. --Redrose64 🌹 (talk) 10:04, 29 December 2020 (UTC)[reply]
Redrose64: Thank you for explaining it so clearly. —Anomalocaris (talk) 10:45, 1 January 2021 (UTC)[reply]