Wikipedia:Don't use hiddenStructure: Difference between revisions
Content deleted Content added
→Problems: Google cache only shows hiddenstructure when the template call is malformed - http://en.wikipedia.org/w/index.php?title=Cardinal_Health&diff=43842674&oldid=41480543 |
Locke Cole (talk | contribs) m rvt |
||
Line 1:
Recently a [[cascading style sheets]] (CSS) "hack" known more generally as "[[Wikipedia:HiddenStructure|''hiddenStructure'']]" has seen widespread use on Wikipedia. This hack makes it possible to conditionally hide rows of data in tables dependent upon whether or not certain parameters are passed (or are/aren't empty/blank).
Line 14 ⟶ 13:
|}
The problem with using ''hiddenStructure'' is that it hides rows in a non-standard way. Whereas other websites hide data by simply not sending it out from the server<ref>Most websites use PHP or ASP to conditionally send data from the server. More advanced designs cache results so PHP/ASP scripts are only executed once for each possible outcome.</ref>, ''hiddenStructure'' defers this hiding process to the client. Because of this, some non-CSS aware or compliant browsers incorrectly render pages using this hack (see pictures at right).
{| style="float: right; border: none; background: transparent; margin-left: 1em; padding: 0; clear: both;"
|-
| [[Image:Firefox.cardinal health.css.googlecache.png|thumb|150px|[[Cardinal Health]] as seen in Google's cache (via Firefox).]]
|}
Some third party websites which host Wikipedia content may also have trouble with hiddenStructure. For example, Google's cache of webpages has been shown to have hiddenStructure displayed as raw text (see picture at lower right).
Some pages minimize the damage by only displaying the parameter if it's actually non-blank (using the syntax <code><nowiki>{{{parameter|}}}</nowiki></code>). In this way only the row is displayed, not the ugly <nowiki>{{{parameter}}}</nowiki> parameter name. Of course in templates with large numbers of conditional rows, this still results in unnecessary data being displayed to non-CSS compliant browsers.
Line 49 ⟶ 55:
* [[Wikipedia:HiddenStructure]]
* [[Wikipedia:Avoid using meta-templates]] (deprecated/rejected)
|