Help:Infobox/user style: Difference between revisions

From Spiral Framework
Jump to navigation Jump to search
m (1 revision imported)
 
SpiralFramework>Izno
(adjust in preparation for infoboxes going to TemplateStyles)
Line 5: Line 5:


To hide all infoboxes, add the following to [[Special:MyPage/common.css]] (for all [[WP:Skin|skins]], or [[Special:MyPage/skin.css]] for just the current skin), on a line by itself:
To hide all infoboxes, add the following to [[Special:MyPage/common.css]] (for all [[WP:Skin|skins]], or [[Special:MyPage/skin.css]] for just the current skin), on a line by itself:
<source lang="css">.infobox { display: none; }</source>
<syntaxhighlight lang="css">div.mw-parser-output .infobox { display: none; }</syntaxhighlight>


Alternatively, you can add the following code to [[Special:MyPage/common.js|your common.js]] or into a browser user script that is executed by an extension like [[Greasemonkey]]:
Alternatively, you can add the following code to [[Special:MyPage/common.js|your common.js]] or into a browser user script that is executed by an extension like [[Greasemonkey]]:


<source lang="js">$('.infobox').hide();</source>
<syntaxhighlight lang="js">$('.infobox').hide();</syntaxhighlight>


Be aware that although, per [[WP:Manual of Style/Infoboxes]], all information in an infobox should also be found in the main body of an article, there isn't perfect compliance with this guideline. For example, the full taxonomic hierarchy in {{tl|Taxobox}}, and the OMIM and other medical database codes of {{tl|Infobox disease}} are often not found in the main article content. The infobox is also often the location of the most significant, even only, image in an article.<!--
Be aware that although{{#if:{{{guideline|}}}||, per [[WP:Manual of Style/Infoboxes]],}} all information in an infobox ideally should also be found in the main body of an article, there isn't perfect compliance with this guideline. For example, the full taxonomic hierarchy in {{tlx|Taxobox}}, and the OMIM and other medical database codes of {{tlx|Infobox disease}} are often not found in the main article content. The infobox is also often the location of the most significant, even only, image in an article.<!--


Needs Special:Mypage/common.js options for:
Needs Special:Mypage/common.js options for:
Line 22: Line 22:
This documentation snippet is transcluded at [[Help:Infobox]], [[Template:Infobox/doc]], [[WP:Customisation#Hiding specific messages]], [[Help:User style]], [[WP:Manual of Style/Infoboxes]], and other places where this information is relevant.
This documentation snippet is transcluded at [[Help:Infobox]], [[Template:Infobox/doc]], [[WP:Customisation#Hiding specific messages]], [[Help:User style]], [[WP:Manual of Style/Infoboxes]], and other places where this information is relevant.


As a template, this snippet takes a {{para|heading}} parameter to replace the level-2 <code>==Infoboxes and user style==</code> section heading code, as needed. E.g, for a <code>=== ... ===</code> level-3 heading: <code><nowiki>heading={{=}}{{=}}{{=}}Infoboxes and user style{{=}}{{=}}{{=}}</nowiki></code>
As a template, this snippet takes a {{para|heading}} parameter to replace the level-2 <code>==Infoboxes and user style==</code> section heading code, as needed. E.g., for a <code>=== ... ===</code> level-3 heading: <code><nowiki>heading={{=}}{{=}}{{=}}Infoboxes and user style{{=}}{{=}}{{=}}</nowiki></code>
}}
}}
</noinclude>
</noinclude>

Revision as of 08:29, 12 October 2021

Infoboxes and user style

Users can have user CSS that hides any infoboxes in their own browsers.

To hide all infoboxes, add the following to Special:MyPage/common.css (for all skins, or Special:MyPage/skin.css for just the current skin), on a line by itself:

div.mw-parser-output .infobox { display: none; }

Alternatively, you can add the following code to your common.js or into a browser user script that is executed by an extension like Greasemonkey:

$('.infobox').hide();

Be aware that although, per WP:Manual of Style/Infoboxes, all information in an infobox ideally should also be found in the main body of an article, there isn't perfect compliance with this guideline. For example, the full taxonomic hierarchy in {{Taxobox}}, and the OMIM and other medical database codes of {{Infobox disease}} are often not found in the main article content. The infobox is also often the location of the most significant, even only, image in an article.