Jump to content

Wikipedia talk:HiddenStructure

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

CSS hack reduces accessibility

[edit]

(moved from MediaWiki_talk:Common.css -- Netoholic @ 15:35, 27 January 2006 (UTC))[reply]

I just learned about the CSS hack being added to a number of templates, to compensate for a changed policy on template transclusion. I understand that there is an alternative way of recoding these templates, but the CSS hack is being implemented because its easier. Main discussion on this is at Wikipedia talk:No meta-templates. Please make your opinion heard there.

This hack injects junk code into the body of the page, then hides it from most visual browsers using CSS. The following line in common.css is being used to hide this code in template:Journal reference, template:Taxobox, and many others:

 /* hiddenStructure from Monobook - allows selective hiding of markup in templates */
 .hiddenStructure {
    display: none;
 }

This makes Wikipedia less accessible for users of assistive technologies, like web page readers for the handicapped, and text readers. This is sloppy programming and bad practice from the point of view of web page accessibility, web page usability, and standards implementation. Wikipedia is an open encyclopedia; please lets not start treating the minority who has the most difficult time reading like second-class citizens. Michael Z. 2006-01-16 17:51 Z

Michael- I am concerned about accessibility myself, and a while ago I started to document some good practices at Wikipedia:Accessibility. Specific to this "CSS hack", we can add "speak: none;" to hiddenStructure. I think that addresses your concern. -- Netoholic @ 19:05, 16 January 2006 (UTC)[reply]
I would disagree—I don't think this would cover all situations; definitely wouldn't work in a text-only browser like Lynx. "Hidden structure" is just that: structure that shouldn't be there—hiding it with CSS is an ugly hack. I must run now, but I will come back to put a more thoughtful 2¢ in. Michael Z. 2006-01-16 19:15 Z
Hiding structure with CSS is a very common practice, and our specific use is even a little elegant. As far as the argument about the lynx browser, you're a little late as it's been discussed before. Lynx/Links browsers make up fewer than 0.03% of the readers here. What should be done is to avoid using too many optional parameters in any template, but there really aren't anymore hard-core lynx users, so I think the argument is a straw man. -- Netoholic @ 19:25, 16 January 2006 (UTC)[reply]
"Elegant?" You can't be serious. Your code can't produce the right HTML, so leave the cruft in, then use CSS to hide it. This is not elegant, it's bush league.
So 0.03% of users of one of the world's busiest web sites are insignificant? Lynx is an open source browser with just about the most compliant HTML engines available. You think that the web page breaking in Lynx is an "elegant use"? Are blind readers an insignificant minority in your opinion too?
And all of this when the weeble solution would work? Amateurish and unworthy. Michael Z. 2006-01-16 19:46 Z
The HTML/CSS is just fine. All we are doing is outputting the name of a CSS class that doesn't exist, which is acceptable under CSS validation. Lynx/Links users were 0.03% in February 2004. If you extrapolate over time and assume that several people use lynx just to test what the site looks like under lynx, it's far fewer real users. Also, those that use lynx know and expect that they are losing functionality. You want to know a better solution altogether? Don't use templates for references on a permanent basis. -- Netoholic @ 20:00, 16 January 2006 (UTC)[reply]
Netoholic, Would you remove occurences of "|if=" on template calls if you see them or would you let us live with the weeble variant. Michael announced that he would remove any call to templates that use the CSS on pages which he has a major interest. How about you in the CSS camp? Do you intend to abolish any occurence of weeble on sight or would you let us live with weeble. Note: weeble code does not violate WP:AUM. So with weeble we can both satify your beloved WP:AUM and Michael. Weeble does not violate anything (besides your preference) so this is a simple content dispute on templates. --Ligulem 21:42, 16 January 2006 (UTC)[reply]
I am confident that in the long run, people will much prefer CSS over that odd weeble method. CSS makes the template itself pretty to edit, and has lead to a lot of interesting applications because of that. I won't systematically remove all occurences of it, but I ask that you not make such a change to any template such that you have to go out and add "if=|" to pages. -- Netoholic @ 22:21, 16 January 2006 (UTC)[reply]
Ok then. But this is the same because we cannot work against you on templates as it is pointless to revert you. So if you insist on CSS on journal reference (and others) we have only the option watching Michael removing calls to journal reference. And this is anyway what you prefer right? Damned. Everywhere is somebody against something. Goodby citation templates. --Ligulem 22:34, 16 January 2006 (UTC)[reply]
With respect, why do you need citation templates? Citation styles are not about to change over time, are they? They should be inserted in plain text, by preference. I have even written a tool to aid this [1]. If people appreciate it, I can extend this to other templates. [[Sam Korn]] 22:36, 16 January 2006 (UTC)[reply]
In fact we do not need any template. We can always insert everything "by hand" in any article. If this is the consensus (for citation templates), ok then. --Ligulem 22:52, 16 January 2006 (UTC)[reply]
"The HTML/CSS is just fine"—Netoholic, it is not fine. The literal text of the HTML page contains meaningless junk, generated because you can't control the output of a template! You can't justify that by saying some browser is used by some tiny minority. This contravenes word and spirit of the Web Content Accessibility Guidelines [2], including the two main themes "graceful transformation" and "understandable and navigable content", and guideline 3 "Use markup and style sheets and do so properly", guideline 9 "design for device-independence", and especially checkpoint 6.1 "Organize documents so they may be read without style sheets". The last is a priority 1 checkpoint—ignoring it means that Wikipedia will fail the most basic standard of accessibility.
"Don't use templates for references on a permanent basis"—perhaps that is the best solution. The old meta-templated templates could be subst-ed, as a shortcut method to create good clean HTML citations. Michael Z. 2006-01-16 23:13 Z
Comment: Templates that contain a call to qif cannot be substed. --Ligulem 23:25, 16 January 2006 (UTC)[reply]

CSS solution only works where CSS is available. The non-CSS camp can produce a WP for HTML conforming user agents and robots. The CSS hack camp needs HTML+CSS conforming agents. Download of data dump is not longer all - you also need to download and implement WP-CSS. Easy use / openess of WP is reduced by the CSS hack. Tobias Conradi (Talk) 23:01, 16 January 2006 (UTC)[reply]

This is not a good idea. The whole point of CSS is to make multiple "text-only" versions of web sites, for accessibility reasons, unnecessary. CSS is meant to style an HTML page, which should be completely understandable without it. The problem here is that Netoholic can't control the output of these templates, and they add junk content into the HTML. Then he layers CSS on top of it to hide the junk from some browsers. This is not just a hack, it's an ugly hack, which breaks W3C guidelines for accessibility in ways not previously imagined. Michael Z. 2006-01-16 23:41 Z
You're becoming very repetitive, and not very informative. "junk content into HTML" - I have no idea what you mean by that at all. Your concerns are better addressed by making sure use of the CSS method is done minimally and selectively, but we gain nothing by ignoring the potential it brings. Sounds like you need to take up specifice concerns on the specific templates you're worried about, because I don't even think I could put a cap on hiddenStructure usage now. It's out there, it works well for our needs. -- Netoholic @ 01:40, 17 January 2006 (UTC)[reply]
You have no idea? "Junk content" is all the stuff you hide from visual browsers with CSS. For those who haven't seen it, examples of the actual output are at template talk:Infobox Language.
I have considered the 'potential' of this method to allow you to write more templates which indiscriminately output crap, and then add more code to hide it from most non-handicapped readers. My specific concerns are this fundamental flaw with the method and concept behind it.
Below is an excerpt from the output of Netoholic's proposed language template. Full output at the link above. This is not the wikicode, but the actual text that a handicapped reader might have to listen to before he got to the start of the article. Michael Z. 2006-01-17 01:51 Z
  Language codes                                                               
  ISO 639-1: en                                                                
  ISO 639-2: eng                                                               
  ISO/DIS 639-3: eng --                                                        
  {{{lc1}}} -- [[{{{ll1}}}|{{{ld1}}}]]                                         
  {{{lc2}}} -- [[{{{ll2}}}|{{{ld2}}}]]                                         
  {{{lc3}}} -- [[{{{ll3}}}|{{{ld3}}}]]                                         
  {{{lc4}}} -- [[{{{ll4}}}|{{{ld4}}}]]                                         
  {{{lc5}}} -- [[{{{ll5}}}|{{{ld5}}}]]                                         
  {{{lc6}}} -- [[{{{ll6}}}|{{{ld6}}}]]                                         
  {{{lc7}}} -- [[{{{ll7}}}|{{{ld7}}}]]                                         
  {{{lc8}}} -- [[{{{ll8}}}|{{{ld8}}}]]                                         
  {{{lc9}}} -- [[{{{ll9}}}|{{{ld9}}}]]                                         
  {{{lc10}}} -- [[{{{ll10}}}|{{{ld10}}}]]                                      
  {{{lc11}}} -- [[{{{ll1}}}|{{{ld11}}}]]                                       
  {{{lc12}}} -- [[{{{ll2}}}|{{{ld12}}}]]                                       
  {{{lc13}}} -- [[{{{ll3}}}|{{{ld13}}}]]                                       
  {{{lc14}}} -- [[{{{ll14}}}|{{{ld14}}}]]
That seems to be, again, a concern about a specific template. And please stop with the handicapped issue, if I was an admin, I'd add "display: none;" immediately. That ends your argument completely because there are no screen readers that ignore CSS. Lastly, that visible text is not "junk HTML" (a phrase that implies the HTML is invalid or against standards). -- Netoholic @ 02:08, 17 January 2006 (UTC)[reply]
Display:none doesn't remove content from a web page, it just hides it from certain web browsers. Sorry, not "junk HTML", junk text in the HTML, plus some HTML span elements specifically generated to hide the junk.
How do you know there are no such screen readers? How do you know that one won't be released tomorrow? Using CSS to hide content which was "accidentally" added to a web page breaks WCAG priority 1 accessibility, as I explained above. Ignoring this is totally contrary to Wikipedia's "open" philosophy, and is just a shoddy way to build web pages. Michael Z. 2006-01-17 02:10 Z
I believe Blynx (being a Lynx derivative for Blind people) has no support for CSS MrWeeble Talk Brit tv 15:29, 17 January 2006 (UTC)[reply]
Comment: just an example for what the CSS trick does on the html of Royal Welch Fusiliers:
<tr class="hiddenStructureExpansion of the Army to oppose James II and the imminent war

with France. Originally the 23rd Regiment of Foot; it became the Royal Welch Fusiliers in 1713 as a reward for great gallantry under Marlborough."> <th>Reason for creation</th> <td>Expansion of the Army to oppose James II and the imminent war with France. Originally the 23rd Regiment of Foot; it became the Royal Welch Fusiliers in 1713 as a reward for great gallantry under Marlborough.</td> </tr> Long class name that. --Ligulem 17:46, 17 January 2006 (UTC)[reply]

Ew. — Omegatron 20:41, 17 January 2006 (UTC)[reply]
A class attribute contains a space-delimited list of classes, so this is a serious problem. For example, depending on the content of such a note, parts of the page could arbitrarily be put into the existing classes in monobook.css and common.css: .selected, .thumb, .error, .external, .text, .notice, .metadata, .messagebox, .infobox, .bordered, .IPA, .Unicode, and .polytonic. There may also be a limit to the number of characters allowed in a class attribute. Michael Z. 2006-01-17 21:07 Z
This is only the case where the parameter contains un-wiki-linked words or phrases. HTML Tidy strips out the entire class= statement. See the page source of Royal Welch Fusiliers after I made this change. -- Netoholic @ 01:39, 18 January 2006 (UTC)[reply]
Which is now:

<tr> <th>Reason for creation</th> <td>Expansion of the Army to oppose <a href="/enwiki/wiki/James_II_of_England" title="James II of England">James II</a> and the imminent war with France. Originally the 23rd Regiment of Foot; it became the Royal Welch Fusiliers in 1713 as a reward for great gallantry under Marlborough.</td> </tr>

Looks good now. --Ligulem 15:20, 18 January 2006 (UTC)[reply]
That's a workaround for this particular case, but the CSS hack used in this template and others still risks unexpectedly breaking page rendering in any occurence. Michael Z. 2006-01-18 22:06 Z
Changed Template:Infobox British Army regiment to use updated CSS trick. No more random CSS classes, only "hiddenStructure". Nothing else. --Ligulem 22:08, 20 January 2006 (UTC)[reply]

Having web sites which are inaccessible also violates assorted corporate policies and laws, which might affect who is able to host mirrors. A related side effect is that if the MediaWiki does not support an accessible version of a desired feature then MediaWiki will be less likely to be used for non-Wikipedia sites. (SEWilco 19:04, 16 January 2006 (UTC))[reply]

Why Not Weeble?

[edit]

(moved from MediaWiki_talk:Common.css -- Netoholic @ 15:35, 27 January 2006 (UTC))[reply]

Can anything be done using the CSS hack that can't be done with the "weeble" method? Superm401 | Talk 09:26, 17 January 2006 (UTC)[reply]

Weeble needs an additional artificial parameter with name "if" that must be defined and empty on each call of a template that uses the weeble trick (written as "|=if"). --Ligulem 10:13, 17 January 2006 (UTC)[reply]
So what "can't be done" with the 'Weeble' method (which has actually been around for a while... Template:If defined uses it) is to convert many templates to non-meta forms without changing the template calls. That being said... for alot of the more complicated templates the calls are being changed anyway. In such cases I think we should use Weeblecode since it's biggest drawback (having to update each call) is required anyway.

Another option would be to decide that a few 'meta' aspects are 'ok'. If we can get rid of all the 'Boolean' and 'If' templates then is it really such a threat to have a few double transclusions that get used on a couple hundred pages? I don't think so and I don't think there will ever be a way to eliminate such. If some basic double transclusions are allowed then the '|if=' calls can be made in the top level templates... causing no change to many template calls. For instance, if Template:Language were changed to call Template:Infobox language, Template:Infobox Conlang, or Template:Infobox Sign language, depending on the type of language, then the calls to 'Language' on various pages could remain unchanged, the '|if=' conditions could be set in 'Language' before calling the sub-templates, and the different language templates could be customized more. This might also reduce load from changes by splitting out into sub-templates. However, it'd be a 'meta' (more accurately 'nested') template. Just barely, as it's only double transclusion, but others of this sort have recently been proclaimed 'anathema'... though many many more have been ignored / left in place. I think this is really the best solution currently available, but is it possible in the face of the 'meta-template jihad'? --CBD 12:10, 17 January 2006 (UTC)[reply]
That method first of all require 4 templates when 3 will do, just change the articles to call the right template (it's easy). Your suggestion also breaks the intended purpose of Whatlinkshere. What is so damn hard about manually keeping these three templates looking alike? By splitting the templates, we can remove A LOT of the extraneous optional parameters, which cleans up the HTML source. -- Netoholic @ 20:42, 17 January 2006 (UTC)[reply]
I personally have nothing against weeble as we have now very strong opposition against CSS which only leaves the "remove calls" option on my beloved template book reference. BTW, does anyone of the experts know what google does for example with <tr class="hiddenStructure"><th>Died</th><td><br /></td></tr> as can now be found in the html source of GWB (see also below)? --Ligulem 12:25, 17 January 2006 (UTC)[reply]
Why do book references need templates? They're not going to change. It seems to me unnecessary to use ugly (and they are ugly) methods when you can use simple, clean ones. You can insert the reference in plain text. Difficult? I don't think so. [[Sam Korn]] 20:48, 17 January 2006 (UTC)[reply]
You are welcome to express your opinion on template talk:book reference. I have asked there how to proceed with that template. --Ligulem 21:40, 17 January 2006 (UTC)[reply]

The problem with weeble is it makes templates harder to maintain (since it looks messier) ··gracefool | 02:49, 16 February 2006 (UTC)[reply]

Change request

[edit]

(moved from MediaWiki_talk:Common.css -- Netoholic @ 15:35, 27 January 2006 (UTC))[reply]

Could some admin please change

/* hiddenStructure from Monobook - allows selective hiding of markup in templates */
 .hiddenStructure {
    display: none;
 }

to

/* hiddenStructure from Monobook - allows selective hiding of markup in templates */
 .hiddenStructure {
    display: none;
    speak: none;
 }

As proposed by Netoholic above? Example: look at the html code of George W. Bush. You will find there:

<tr class="hiddenStructure">
<th>Died</th>
<td>{{{death_date}}}<br /></td>
</tr>

Due to the CSS trick used in template:Infobox President. Would be good if "Died" would not be spoken out on that article (especially not on that article). --Ligulem 10:26, 17 January 2006 (UTC), Updated --Ligulem 22:55, 17 January 2006 (UTC)[reply]

Is it possible to simply remove the word "died" from the article about George W. Bush, instead? Michael Z. 2006-01-17 16:08 Z
That word comes from the transclusion of the template template:Infobox President into that article. The html snippet I presented origins from that transclusion. If you remove that transclusion, then that word is removed (but also the infobox). Hmm, I strongly think I didn't get what you mean... --Ligulem 16:20, 17 January 2006 (UTC)[reply]
I meant: can the template be fixed so it doesn't insert unintended words or field names into the page? This could be a problem for Google or other search engines. Michael Z. 2006-01-17 21:10 Z
I try to be short: with weeble code, that would be possible (rejected by Phil Boswell and Netoholic). With qif it was no problem (to be killed soon with an axe by David Gerard or Snowspinner and lots of others). With conditional templates in MediaWiki it would be plain kindergarten (devs fear "wiki viruses", said "kill if/qif with a stick"). So the answer is: NO. As I already said: remove the template (option of last resort). --Ligulem 21:54, 17 January 2006 (UTC)[reply]
Just for a note: I dislike the CSS hack too (won't reiterate the reasons already listed above.) I'm not active in English Wikipedia, but I work in Russian section and recently we are having a massive introduction of CSS hack copied from English. I personally think I'll just stick with qif in my templates for a while, since Russian Wiki is not that large. I really hope conditionals are introduced into the wiki syntax soon so that we don't have to choose between an ugly hack solution (CSS), a slow hack solution (meta-templates) and an iconvenient hack solution (Weeble.) -- Paul Pogonyshev 21:28, 20 January 2006 (UTC)[reply]

Obviously, this change is beneficial, whether you like the hiddenStructure method or not. -- Netoholic @ 20:44, 17 January 2006 (UTC)[reply]

Despite my antipathy towards the system, I have changed the style as requested. [[Sam Korn]] 20:51, 17 January 2006 (UTC)[reply]

I just had a look at "George W. Bush" using Lynx. The entire article displays perfectly, except the infobox ({{Infobox President}}) renders like this (note "Died"):

CAPTION: George W. Bush

Order 43rd President of the United States
President from January 20, 2001 - present
Vice President Dick Cheney
Preceded by Bill Clinton
Succeeded by incumbent
Born July 6, 1946
New Haven, Connecticut
Died
Political party Republican
Spouse Laura Welch Bush
                                                                               

And several instances of {{main}}, looking something like this:

Main articles: Early life of George W. Bush, and Professional life of George W. Bush, and [[]], and [[]], and [[]]

Both are breakages of the actual content of Wikipedia, and both caused by using the CSS hack to compensate for faulty output of templates. Michael Z. 2006-01-18 00:34 Z

If I would get a license to do so, I would convert template:Infobox President to weeble (am thinking about doing a mockup under my user space). But as long as I get oppositon from that prominent people I can't do anything. Especially Neto (with his big license plate) would revert me within milliseconds. --Ligulem 10:37, 18 January 2006 (UTC)[reply]
Something you could do is in the template instead of blank text ie {{{death_date}}} try and add some text that exlains that he is still extant ie {{{death_date|Still alive [[as of 2006]]}}} which would result in:
Died: Still alive as of 2006
Not particularly nice way of doing it, but at least it would avoid confusion as to his current status.
<sarcasm>Of course, we could just shoot him, might be the easiest solution</sarcasm> – MrWeeble Talk Brit tv 10:57, 18 January 2006 (UTC)[reply]
Ligulem, I would support replacing any CSS hack template with a weeble version. It's been implied that the weeble version's template code is not as pretty, or not as flexible or something, but I haven't actually seen why it's opposed. Given the problems already demonstrated for the other method, don't you think we could find consensus for the version that actually works? Michael Z. 2006-01-18 22:09 Z
The only clear drawback I see is that additional |if= parameter on calls (sorry for constantly repeating this). I haven't seen any other technically based arguments against weeble so far, so I do not know too why weeble is attacked that heavily. Ok it is another "hack" solution, but only until we have a conditional in MediaWiki. You are not alone against the CSS hack, I think Garzo and the group around template:language is also headed towards weeble based on similar arguments as you brought here. My problem is that Phil Boswell obviously wants to wait onto the "real" solution (conditionals in MediaWiki) and Netoholic simply revert wars any template with weeble. Given that I personally follow a zero-revert rule towards edits of Neto, I'm pretty much blocked (see also Neto's actions on template:language and Wikipedia:Administrators' noticeboard/Incidents#Inappropriate page move protection by User:Radiant!. He has pretty much a license to do anything. I would go with weeble in order to get you on board. I see nothing wrong with weeble. It's quite frustrating all this WP:AUM terror. But we can't ignore WP:AUM because we get shot sooner or later. --Ligulem 22:25, 18 January 2006 (UTC)[reply]
I must add that for template:Infobox President I tend to weeble anyway because of these texts in the html source ("died"). So for Infobox like stuff, I would prefer weeble. For the citation templates it is not that bad to use the CSS hack because there are not such dangerous texts to hide. --Ligulem 22:37, 18 January 2006 (UTC)[reply]
What happens if the |if= parameter is omitted or mistyped? Do trivial mistakes like typing an extra space break the template?
Having to type that is far less of a problem than the several drawbacks already discovered for the CSS hack. The danger of adding unexpected random classes into class attributes in particular could have all kinds of unpredictable results: definitely breaks accessibility, definitely could break page layout, might be able to break standards compliance, might adversely affect a browser's HTML parser by adding dozens or hundreds of classes to one or more HTML elements. These confirmed, probable and possible adverse effects on readers of Wikipedia far outweigh the burden on an editor of having to type four extra characters into a template once. Michael Z. 2006-01-19 00:12 Z
Ops. I'm a bit late responding here. Just in case you havent seen: take a closer look at my doc about the Netoholic variant (aka CSS trick). Netoholic invented a new way so that only the class "hiddenStructure" is used. Nothing else. So there aren't any random CSS classes any more. Please note that the CSS trick might get replaced by something better in the future (possibly MediaWiki code). It's certainly not meant as a definitive solution. --Ligulem 21:45, 20 January 2006 (UTC)[reply]
Thanks, but I still don't know if the only objection to the "weeble" method is the necessity of adding the |if= parameter. In what way does it break if the parameter is omitted or incorrectly typed? Michael Z. 2006-01-22 22:08 Z
If the blank '|if=' parameter is not included then the conditional logic fails and displays the text automatically... essentially it winds up looking like the 'hiddenStructure' trick does on non-CSS browsers. That being said, as the 'weeble' method becomes more common the likelihood of the '|if=' parameter being ommitted decreases. I really think this method is inherently superior to the CSS hack and even many current meta-template implementations. The only significant drawback is that existing template calls would have to be updated. I've been using it with newly designed templates (see Template:User Infobox) and as part of internal meta-template calls (see how Template:Language calls Template:Language/genetic). In the first case many people, several of them 'newbies', have used the template and had no trouble understanding and including the 'if='. In the second case the extra 'if=' parameter is set inside the top level template (getting rid of extra calls to qif and switch in the process) and the change was effectively invisible to the users. --CBD 22:30, 22 January 2006 (UTC)[reply]
Given the newest statments from Brion VIBBER on WP:AUM we might even consider waiting until the conditional support has been added to MediaWiki and continue using qif in the mean time. So I would recommend waiting a bit what happens around Brion on that matter before we are going to do (or continue) a lot of useless work. WP:AUM is no longer a policy. See also Wikipedia talk:Avoid using meta-templates#What I need from you. --Ligulem 00:23, 23 January 2006 (UTC)[reply]

CSS hack reduces accessibility, confirmed

[edit]

(moved from MediaWiki_talk:Common.css -- Netoholic @ 15:35, 27 January 2006 (UTC))[reply]

Netoholic wrote "And please stop with the handicapped issue, if I was an admin, I'd add "display: none;" immediately. That ends your argument completely because there are no screen readers that ignore CSS". But please see template talk:Main#Strange output; there's already a blind editor using Jaws (the most common screen reader) adversely affected by the CSS hack. Michael Z. 2006-01-22 22:03 Z

Yes, I am affected: {{main}} is the place where I notice it the most.
Thanks for bringing this up here. And I personally do appologize for being one of those who have been adding that CSS hack to templates and thus indirectly to articles. Until recently we had a policy (WP:AUM) that mandated the removal of a technical solution which was deemed to be bad for the servers. Instead of working for a decent technical solution we went mad and put up the CSS hack because some of us had the opinion that this would be ok as a stop gap measure in order to avoid the removal of templates from articles. It all boils down to that we were told to no longer use templates in templates and especially not template:qif which was put up as a temporary solution until we have conditional logic support for templates in MediaWiki software (which we are still desparately waiting for). That qif produced decent html (also for your screen reader and all non-CSS browsers), but had been announced for removal by important Wikipedians due to ugliness, fragility and server strain. The result is now that the consensus (as established by the actual Wikipedia consensus-finding capabilities) was to replace that qif with the CSS hack, thereby ignoring people like you, based on reason that users like you are a small minority of users and that we should thus no longer support non-CSS browsers. Note however that there was and is a significant fraction of wikipedians who think that this CSS hack should not be used. There is another technical solution for conditional logic in templates (called weeble trick) that also produces decent html but which was refused to use by important participants in this anti-templates-in-templates crusade because it needs an additional artificial paramter that must be named "if" and be defined to be empty on every call to a template that uses the weeble trick. Now to all Wikipedians: do we want to ignore people like the person here who said she/he has problems reading Wikipedia articles caused by the CSS hack? I would appreciate if we could either stop the removal of qif calls until we have support for conditionals in MediaWiki or use the weeble trick which at least produces decent html. Thanks to all for your careful consideration. Sorry for being verbose once again. --Ligulem 08:36, 23 January 2006 (UTC)[reply]
Given recent statements from Brion that meta-templates are not a major server problem and that they are looking at ways to allow conditionals in MediaWiki I'm all for wiping out the CSS hack entirely. There is no longer any reason for it. Maybe it improves server performance slightly while we are waiting for 'built in' conditional logic, but that's not worth the accessibility problems. I'd say use 'weeble' if it can be done easily or just go back to 'qif' otherwise. --CBD 11:47, 23 January 2006 (UTC)[reply]

I've just found out that the template works fine in jaws 6.0, so it would probably work fine in all versions after that. However, it's a paid upgrade for me, and many would have a good reason to use versions of jaws below 6.0. They use a more flexible authorisation scheme, have an easier-to-use directory structure, and are generally more responsive on slower computers. Therefore, I would strongly recommend that the css hacks not be used because there will be a sizable number of people using older screen readers, and they may not be able to upgrade. Graham/pianoman87 talk 05:08, 23 January 2006 (UTC)[reply]





Notes on accessibility

[edit]

Per this, it seems these are really the wrong way to go about handling conditionals in templates. —Locke Coletc 16:04, 23 January 2006 (UTC)[reply]

See also Wikipedia CTO Brion VIBBER's statement about the CSS hack. --Ligulem 18:04, 24 January 2006 (UTC)[reply]

I've added a comment to this effect onto the main page. Basically, the template should be readable and make sense without hiddenStructure enabled. Design the template first, then add minimal hiddenStructure to it, and everything will be fine. -- Netoholic @ 17:17, 25 January 2006 (UTC)[reply]

CSS was not designed to abuse it on the client side for hiding information the servers are unable to omit from fusing into the html. Instead of abusing CSS for these kind of things you might better invest your time in helping to add the missing conditional functions to MediaWiki so that we have html that conforms to well known standards and requirements. See also the comments starting at MediaWiki talk:Common.css#CSS hack reduces accessibility by Mzajac and MediaWiki talk:Common.css#CSS hack reduces accessibility, confirmed as well as the comments by affected visually impaired user Pianoman87 which uses a screen reader. --Ligulem 09:46, 27 January 2006 (UTC)[reply]
My statements stand. Better template design in the first place is the best way to avoid needing hiddenStructure and avoid using meta-templates. Also, if MediaWiki included a non-visual stylesheet that worked, we could avoid this argument completely. I think that would be better in the long term. -- Netoholic @ 15:23, 27 January 2006 (UTC)[reply]
Agreed that better template design is important. By non-visual style sheet, do you mean for aural media, etc? A workaround could be to to use an @media selector, but carefully: I think support for this in both visual browsers and screen readers is spotty. Ultimately a separate style sheet would be better. FYI, the full list of media types is All, Aural, Braille, Embossed, Handheld, Print, Projection, Screen, Tty, Tv. Michael Z. 2006-01-27 17:59 Z

discussion copied from my talk page

[edit]

Copied from user talk:pianoman87, so I don't get the "new messages bar and because this is a more appropriate place: <

Hi. You might want to put Wikipedia talk:hiddenStructure on your radar. --Ligulem 09:54, 27 January 2006 (UTC)[reply]

yes, I've added it to my watchlist now. I didn't realise how ugly the method actually was until I read the explanation on the main page. Graham/pianoman87 talk 10:11, 27 January 2006 (UTC)[reply]
It's not that ugly, if we can just figure out some specifics. In looking at a Wikipedia page source, the Common.css stylesheet seems to be loading, and so I'm unclear why your new JAWS version isn't supressing hiddenStructure. Can I ask what (if any) you've set as your skin in Special:Preferences? -- Netoholic @ 15:46, 27 January 2006 (UTC)[reply]
I said that jaws 5.1 and below, which are earlier but not entirely obsolete versions, do not load common.css. As I've said before, many blind users would either be forced to stick with those versions or have a good reason not to upgrade (and if the software maintenance agreements have expired, upgrading costs from 160 to 260 US dollars). I don't personally think that we should be using invalid html just for the sake of not using meta templates, and I suspect that the use of HTML Tidy for these templates might impact server performance. I think I've laid out my views on this issue now. I've copied this discussion to Wikipedia talk:HiddenStructure. Please reply there. Graham/pianoman87 talk 15:55, 27 January 2006 (UTC)[reply]
That is a common misperception - this method does not use "invalid HTML". Both the the CSS and HTML work properly per their standards. I also doubt seriously that the HTML Tidy process, which runs on every article all of the time, is a concern. Certainly, it is less of a concern than the database server impact of meta-templates, which may or may not be very minimal. Thanks for your input. I hope that I interpret you correctly when I say that Jaws versions above 5.1 do correctly suppress the hiddenStructure text. -- Netoholic @ 17:25, 27 January 2006 (UTC)[reply]
Yes, you have interpreted me correctly. Graham/pianoman87 talk 05:11, 28 January 2006 (UTC)[reply]
One may argue that although it doesn't break technical validation, it is completely contrary to the intent of the standards. The CSS2.1 standard mentions in the very first paragraph of its abstract that its purpose is "separating the presentation style of documents from the content of documents," [3] and what this technique does is 1. introduce undesirable "content", and 2. attempt to hide it using a tool intended only for presentation style. Michael Z. 2006-01-27 18:01 Z

Advocacy

[edit]

I have reservations about this page advocating this method without making it clear that it is undesirable, and should only be used where absolutely necessary, and only be considered an interim measure. It is difficult to understand the implications of this technique without a solid understanding of wikitext, template programming, HTML, CSS and accessibility issues, and this knowledge could easily be misunderstood and misused to the detriment of Wikipedia.

I have already received comments from another editor who was under the impression that I was advocating accommodating an insignificant minority of "crippled" users while "crippling" Wikipedia for the majority; see user talk:Mzajac#CSS and visually impaired. Michael Z. 2006-01-27 18:30 Z

I started this page (under my user space and moved it to Wikipedia name space where Netoholic moved it to "HiddenStructure") just to document what is actually happening. This trick is simply spreading very fast (see Category:Infobox templates) and despite my disliking of it I think it is good to have a decent documentation of it. So all involved parties should know what they are doing. Since the vaporization of WP:AUM there is not much motivation left to use that CSS hack (for me I see none). I would propose to use qif until we have conditionals in MediaWiki. qif produces decent html. --Ligulem 18:40, 27 January 2006 (UTC)[reply]

Squabble over wording

[edit]

Come on Netoholic! You removed "Some people consider" from "using CSS to hide unintentionally-created document structure is considered poor web authoring practice." [4]. Who considers adding unintentional structure to an HTML document and then hiding it with CSS good practice? It's used as an expedient with (debatable) justification, but even you don't consider this good authoring practice, do you? Michael Z. 2006-01-28 06:35 Z

I don't consider it bad practice, and to be honest I'm not aware of any other application of such a thing, so its unfair to use definite terms like that. -- Netoholic @ 07:41, 28 January 2006 (UTC)[reply]
It's totally fair. It's not done because it's bad practice, and you're the only person who refuses to believe that. Michael Z. 2006-01-28 16:47 Z

benchmark

[edit]

I quick and dirty benchmark, using html tidy:

[0:0][azatoth@azabox tmp]$ time ./tidytest.sh test.html

real    0m10.612s
user    0m5.611s
sys     0m4.654s
[0:1][azatoth@azabox tmp]$ time ./tidytest.sh test2.html

real    0m10.224s
user    0m5.405s
sys     0m4.489s
[0:0][azatoth@azabox tmp]$ time ./tidytest.sh test2.html

real    0m10.250s
user    0m5.245s
sys     0m4.673s
[0:0][azatoth@azabox tmp]$ time ./tidytest.sh test.html

real    0m10.940s
user    0m5.619s
sys     0m4.712s
[0:1][azatoth@azabox tmp]$ cat tidytest.sh
#!/bin/bash
for i in {0..10000}; do tidy -config tidy.conf $1 2>&- 1>&-; done
[0:0][azatoth@azabox tmp]$ cat test.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Tidy test</title>
</head>

<body>
  <div classtiiiio="foo">
    hello
  </div>
</body>
</html>
[0:0][azatoth@azabox tmp]$ cat test2.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Tidy test</title>
</head>

<body>
  <div class="foo">
    hello
  </div>
</body>
</html>
[0:0][azatoth@azabox tmp]$ cat tidy.conf
drop-proprietary-attributes: true
quiet: true

AzaToth 19:40, 28 January 2006 (UTC)[reply]

Can guarantee that extra database calls to read even a single nested meta-template (Qif) results in a greater delay... by magnitudes. Perhaps you should start going after people who use <br> vs <br/> first? -- Netoholic @ 00:44, 29 January 2006 (UTC)[reply]
I think Netoholic is correct here. I do not believe that tidy is any significant performance problem. It is called anyway and should run quite fast. The server load which qif does is a drawback and that's why we should have conditionals in MediaWiki. But I do not think that this server load of qif merits breaking accessibility of Wikipedia pages or the extinction of qif at any cost. A decent update mechanism for high use templates in MediaWiki would also be a great help so that editing a high use template no longer locks the database in the order of seconds. We simply do not need a light speed push up mechanism for high use templates. But even that does not merit the extinction of qif at any cost. At least not until we have conditionals in MediaWiki, which would eliminate all the forementioned drawbacks of qif. --Ligulem 09:44, 29 January 2006 (UTC)[reply]

Tidy on Wikitech-l

[edit]

Brion about Tidy: [5]. In reply to [6]. --Ligulem 10:44, 11 February 2006 (UTC)[reply]

The hiddenStructure hack has nothing to do with tidy. I can't believe you're benchmarking tidy performance without even bothering to check that assumption. -- Tim Starling 02:58, 12 February 2006 (UTC)[reply]

Seems that the removal of unknown attributes is done in MediaWiki [7]. --Ligulem 16:07, 12 February 2006 (UTC)[reply]

I'm not able to find where I was told that Tidy handled that. Maybe it did and is no longer the case? -- Netoholic @ 04:58, 16 February 2006 (UTC)[reply]

There is new thread "Sanitizer::removeHTMLtags()" on wikitech-l [8]. --Ligulem 08:44, 16 February 2006 (UTC)[reply]

[edit]

The current Mfd / status actions might need some new facts, I've seen a link to this page on Meta. There are also some links here:

Omniplex  05:52, 17 March 2006 (UTC)[reply]

JFTR, the archived MFD closed by Locke Cole. -- Omniplex 10:55, 6 July 2006 (UTC)[reply]

Deprecation

[edit]

I believe it would be appropriate to tag this page as historical or rejected per the ongoing MFD. If nothing else though, we could customize {{historical}} to state that the instructions are deprecated (and, possibly, direct people to WP:QIF). Thoughts? —Locke Coletc 10:43, 19 March 2006 (UTC)[reply]

Folks will (ab)use this CSS feature, for a tricky case see Template:Doctl(edit talk links history), where I got rid of it. The article is IMHO quite clear why using this trick is an utter dubious idea, especially if it relies on the construction of class names that shouldn't exist. I'd draw the line at invalid XHTML, or any "must not exist" names. A pointer to Category:If templates(edit talk links history) is okay, but this alternative isn't much better, it's only on a different layer. Some of these templates are really esoteric. How about developping this article into a guideline about avoiding display: none tricks? Omniplex 13:04, 19 March 2006 (UTC)[reply]
The hiddenStructure class is in the monobook skin by default, which is how it was found. Disagree with the focus change. -- Netoholic @ 08:18, 20 March 2006 (UTC)[reply]

HiddenStructure is still the only way to hide a table row?

[edit]

I don't see how to hide a wiki-table row except with HiddenStructure. Does anyone know how to use ParserFunctions to do that (or Qif, or anything else)? User:dbenbenn 05:04, 17 April 2006 (UTC)[reply]

See WP:QIF (just replace calls to Qif with calls to #if, getting rid of the test, then and (if you use it) else parameter names). I plan on updating WP:QIF to use #if directly at some point (and probably moving it to another name). —Locke Coletc 05:18, 17 April 2006 (UTC)[reply]
Right, and you can't hide a wiki-table row with Qif, either. As I said above, HiddenStructure is the only way that I know of to hide a wiki-table row. User:dbenbenn 22:49, 18 April 2006 (UTC)[reply]
The provided link to WP:QIF shows how to hide a wiki-table row with QIF. The same works for #if:. QIF was being used to do so well before the HiddenStructure method was even developed. --CBDunkerson 22:52, 18 April 2006 (UTC)[reply]
It seems from that page that there are two options.
  • 1: use html table syntax
  • 2: use a template to hide the pipe from the conditional syntax.
I'd advocate the former as its less likely to be broken in future versions of mediawiki and easier to see whats going on. Plugwash 17:21, 23 April 2006 (UTC)[reply]
"Pick what you like better and then stick to it within the same table / template" is my proposal. Unrelated, you added "possibly" to the question of mirrors also copying common.css: True, but CSS is supposed to be decorative, a mirror trying to offer Wikipedia for special purposes (mobile devices or similar) could try its own solution. -- Omniplex 05:07, 24 April 2006 (UTC)[reply]

I've proposed to merge Wikipedia:Don't use hiddenStructure (edit talk links history) into Wikipedia:HiddenStructure (edit talk links history), they discuss precisely the same topic, different project pages and shortcuts don't help. -- Omniplex 07:31, 1 May 2006 (UTC)[reply]

Good luck with that. Netoholic reverted almost every attempt to change this page to dissuade people from using hiddenStructure, hence why I created a userspace page (and ultimately moved it into project space). IMO, Wikipedia:HiddenStructure should be #redirect'd to Wikipedia:Don't use hiddenStructure. Don't merge anything (and remove references to WP:HIDE from WP:DUH). Do not keep content that explains how to use hiddenStructure. Just point them to the page that tells them it's a very bad idea (because it is), and points them to alternatives like WP:QIF. —Locke Coletc 08:16, 1 May 2006 (UTC)[reply]
There's probably no consensus for a merge in the opposite direction, otherwise they (the cabal) could simply kill the common.css class and be done with it. IIRC I even used a <hr class="hiddenStructure" /> in an Rfd template where CSS-browsers won't need a separator. No idea if that works, but this separator was only relevant for old browsers, therefore I tried to limit its effect. -- Omniplex 10:30, 1 May 2006 (UTC)[reply]
It's built in to the Monobook CSS files, so even if it were removed from MediaWiki:Common.css, it'd still work for people using Monobook (which is the vast majority of people). I'd suggest, in the RFD template anyways, literally using style="display: none;" instead of hiddenStructure. No sense putting a dependency on something that may or may not stay in Common.css. —Locke Coletc 10:39, 1 May 2006 (UTC)[reply]
"IIRC" in Template:Rfd bottom(edit talk links history) wasn't correct, nothing to do. -- Omniplex 10:59, 1 May 2006 (UTC)[reply]
I don't think there is much reason to continue using 'hiddenStructure' now. Brion removed it from the CSS once, but it was put back in due to the 'anti-QIF' brigade still using hiddenStructure extensively at that time. However, I don't think that is going to fly now that built-in conditionals are available. Before too much longer hiddenStructure is likely to simply be removed again... at which point this page and WP:DUH won't really be needed except possibly for historical purposes. --CBDunkerson 13:14, 1 May 2006 (UTC)[reply]
I'm not very impressed by the parser function. As an experiment they're fine, but far from ready for prime time:
  1. [#ifeq: a | b |...] has or had allegedly the same effect as [#ifexpr: a = b|...] for numbers, e.g. 02 = 2.
  2. #if: has issues with {{{1}}} and {{{2}}}, without else part it's not yet clearly better than ifdef.
  3. #switch: (assuming that it works) is more flexible and robust than switch. But the template is a jewel, elegant, simple, even subst'able.
  4. #ifexpr: was a good idea, no doubt about that, but it has probably the same issues as #if:.
  5. #expr: and to that degree also #ifexpr: should ignore any comma in numbers instead of throwing errors.
  6. mod for integer division and div for real division is strange, they should both do integer arithmetic, / can do real division. Who wants "(a div b) round 0" everywhere instead of a simple "a div b"?
  7. The proposal #: was good (instead of the kludge Template:! designed for If-templates, not for parser functions). I'd like at least to hear impossible - maybe that's the problem.
  8. If there was a real reason to kill #rand: I don't know what it was, cache issues?
  9. And the missing string functions are puzzling: If that's known to be the wrong way (i.e. there's a better alternative), then the parser functions are not here to stay, something better will come. In that case the #if:-crusade was a waste of time.
    Or string functions as part of the parser functions are possible and okay, then folks obviously want them. -- Omniplex 15:08, 1 May 2006 (UTC)[reply]
Strike #5, see Variable and Magic words. -- Omniplex 06:55, 3 May 2006 (UTC)[reply]
2: Even with the numbered parameter problem #if: is clearly better than ifdef because it is not subject to all the 'server load' and 'vandalism vector' hysteria.
3: The switch template is subst'able sometimes. Others you get all the case statements on the page, which can be exceedingly messy.
6: Decimals are important. Without them all of the unit conversion templates and Julian date templates, and everything depending on those, would be impossible (or ridiculously convoluted to 'manually' construct a final decimal value). The only reason both '/' and 'div' are used is because there was disagreement over which it should be.
8: The stated reasons were that it could degrade the quality of articles and allow difficult to track vandalism. Neither of which seems particularly likely or difficult to control to me, but that's the reasoning behind removal.
9: String functions would allow vastly greater capabilities and they're probably hesitant to take that step just yet.
The parser functions aren't perfect, but my only real complaint is that #if: still has trouble with table markup that require kludges to circumvent. --CBDunkerson 10:56, 3 May 2006 (UTC)[reply]
Strike #2, general issue with all colon functions not limited to parser functions. -- Omniplex 04:45, 7 July 2006 (UTC)[reply]

Merged

[edit]

Here's the complete old content of the talk page (now redirected):

"Use Weeble code (such as {{row}})." — What is Weeble code? Ardric47 07:11, 24 April 2006 (UTC)[reply]
The ifu (if undefined) in Help:Array, I think. -- Omniplex 07:14, 1 May 2006 (UTC)[reply]

That example used in the "See also" section was redirected to Template:Infobox(edit talk links history) by a Tfd, because it was at this time redundant. That's no longer the case, the latter template doesn't use #if: anymore. Therefore I've posted it on deletion review. -- Omniplex 20:36, 2 May 2006 (UTC)[reply]

There's a straw poll at Template:Infobox seeing if people think conditionals should be included there or not (I think they should; there's little reason in spreading this stuff out). Though if that fails, then yes, Template:Infobox Conditionals should probably be brought back. —Locke Coletc 22:40, 2 May 2006 (UTC)[reply]
Probably we also need a WP:HIDE example, the "see also" links were meant to compare these techniques. An older version of Template:Infobox (the last using hiddenStructure) could do the trick. In theory m:Help:Array offers a comparison, but that's a simple DOW example, no infobox. The other template could be called "Infobox hideous" or similar. -- Omniplex 06:51, 3 May 2006 (UTC)[reply]
Uhm... no. Why on Earth would we educate people on using WP:HIDE when it's so fundamentally flawed (except for a few rare situations)? —Locke Coletc 11:00, 3 May 2006 (UTC)[reply]
It will probaby take some time until we get rid of it everywhere, yesterday I killed another bunch of links in a horrible m:Help:Cascading style sheets page derived from m:Help:User style, and I fear the latter is still in circulation, maybe even here. Checking: yes, sigh. See the edit history of m:Help:Cascading style sheets for some non-encyclopedic comments. -- Omniplex 21:24, 4 May 2006 (UTC)[reply]
Agreed that it'll take time to remove this from service (yet another example of why it never should have entered service to begin with...). Nice hatchet job on m:Help:Cascading style sheets, BTW. =) —Locke Coletc 21:44, 4 May 2006 (UTC)[reply]

Update, the template was resurrected. -- Omniplex 15:56, 23 June 2006 (UTC)[reply]

Rejected-like tag.

[edit]

Since HiddenStructure is controversial and shouldn't be used, I added a form of the "rejected" tag, explaining why it shouldn't be used. Please correct any factual errors I may have made, revert if necessary, etc. Ral315 (talk) 01:25, 27 June 2006 (UTC)[reply]

I've replaced "errors in browsers" by "browsers", not supporting CSS is no error, it's the essence of CSS to be optional, pages not working without CSS are erroneous. Of course there are also infamous browsers like Netscape 4.x, where the CSS is too broken to use it, so the best solution is to disable this wannabe-CSS. That was in one of the last episodes of the browser wars, Netscape had JSS based on JS, otherwise similar to CSS, and Lynx had some obscure LSS. Irrelevant today. -- Omniplex 11:03, 6 July 2006 (UTC)[reply]