Editing
Help:CS1 errors
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Controlling error message display == === Preview messages === When editors preview an article, MediaWiki displays a preview message box under the Preview header. When {{cs1}} and {{cs2}} templates have error or maintenance messages, [[Module:Citation/CS1]] summarizes those messages in the preview message box. Such a message box might look something like this: <div style="margin-left:1.6em" class="mw-message-box-warning mw-message-box"><p>This is only a preview; your changes have not yet been saved! <span class="mw-continue-editing"> [[#editform|→ Go to editing area]]</span> </p><p>Script warning: {{color|#3a3|One or more {{mono|<nowiki>{{</nowiki>[[Template:cite book|cite book]]<nowiki>}}</nowiki>}} templates have maintenance messages}}; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).</p><p>Script warning: {{color|#d33|One or more {{mono|<nowiki>{{</nowiki>[[Template:cite journal|cite journal]]<nowiki>}}</nowiki>}} templates have errors}}; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).</p></div> The summary messages have three components: #'Script warning:' – this prefix is provided by MediaWiki; #a colored ({{color|#3a3|green maintenance}} or {{color|#d33|red error}}) message that identifies the type of template that has a message with a link to that template's documentation; wrapper templates with messages will show the name of the wrapped template, and; #'messages may be hidden' – the message suffix with a help link to this page. Preview messages in the preview message box cannot be hidden. The preview message suffix 'messages may be hidden' means that the template's message(s) may not be visible. To learn how to show or hide template messages, see {{slink||Error and maintenance messages}}. === Error and maintenance messages === <section begin="show_error_messages_help_text" /><section begin="show_all_messages_help_text" />By default, {{cs1}} and {{cs2}} <span style="color:#d33">error messages</span> are visible to all readers and <span style="color:#3a3">maintenance messages</span> are hidden from all readers. To display <span style="color:#3a3">maintenance messages</span> in the rendered article, include the following text in your common [[Cascading Stylesheets|CSS]] page ([[Special:MyPage/common.css|common.css]]) or your specific skin's CSS page and ([[Special:MyPage/skin.css|skin.css]]). (Note to new editors: those CSS pages are specific to you, and control your view of pages, by adding to your user account's [[CSS]] code. If you have not yet created such a page, then clicking one of the <code>.css</code> links above will yield a page that starts "Wikipedia does not have a [[user page]] with this exact name." Click the "Start the User:''username''/''filename'' page" link, paste the text below, save the page, follow the instructions at the bottom of the new page on bypassing your browser's cache, and finally, in order to see the previously hidden maintenance messages, refresh the page you were editing earlier.) <syntaxhighlight lang="css">.mw-parser-output span.cs1-maint {display: inline;} /* display Citation Style 1 maintenance messages */</syntaxhighlight> To display hidden-by-default <span style="color:#d33">error messages</span>: <syntaxhighlight lang="css">.mw-parser-output span.cs1-hidden-error {display: inline;} /* display hidden Citation Style 1 error messages */</syntaxhighlight> Even with this CSS installed, older pages in Wikipedia's cache may not have been updated to show these error messages even though the page is listed in one of the tracking categories. A [[WP:NULLEDIT|null edit]] will resolve that issue. To hide normally-displayed <span style="color:#d33">error messages</span>: <syntaxhighlight lang="css">.mw-parser-output span.cs1-visible-error {display: none;} /* hide Citation Style 1 error messages */</syntaxhighlight> You can personalize the display of these messages (such as changing the color), but you will need to ask someone who knows CSS or at [[WP:VPT|the technical village pump]] if you do not understand how. {{lang|la|Nota bene}}: these css rules are not obeyed by [[Wikipedia:Tools/Navigation popups|Navigation popups]]. They also do not hide script warning messages in the Preview box that begins with "This is only a preview; your changes have not yet been saved".<section end="show_all_messages_help_text" /><section end="show_error_messages_help_text" /> === Properties category highlighting === <section begin="prop_cat_highlight_help_text" /> [[Module:Citation/CS1]] adds properties categories to some CS1|2 citations. Unlike errors or maintenance needs, there is no message when a properties category is added. Properties categories may be temporary or may be perpetual. Editors can use CSS to add special styling to CS1|2 template renderings that will highlight a citation that added a properties category. For example, this template uses a long volume name: :<code><nowiki>{{cite book |title=Title |date=May–Jun 2021 |volume = 1: Long volume}}</nowiki></code> ::{{cite book |title=Title |date=May–Jun 2021 |volume = 1: Long volume}} If you add this to your CSS that citation will render with a {{background|#FFC|pale yellow}} background: :<syntaxhighlight lang="css">.cs1-prop-long-vol {background: #FFC;}</syntaxhighlight> Add one or more of these (with appropriate styling) to your CSS to highlight template renderings when those templates add the associated properties category: ::{{code|lang=css|.cs1-prop-foreign-lang-source {}|}} – subcategories of {{cl|CS1 foreign language sources}} ::{{code|lang=css|.cs1-prop-foreign-lang-source-2 {}|}} – {{cl|CS1 foreign language sources (ISO 639-2)}} ::{{code|lang=css|.cs1-prop-jul-greg-uncertainty {}|}} – {{cl|CS1: Julian–Gregorian uncertainty}} ::{{code|lang=css|.cs1-prop-location-test {}|}} – {{cl|CS1 location test}} ::{{code|lang=css|.cs1-prop-long-vol {}|}} – {{cl|CS1: long volume value}} ::{{code|lang=css|.cs1-prop-script {}|}} – subcategories of {{cl|CS1 uses foreign language script}} ::{{code|lang=css|.cs1-prop-tracked-param {}|}} – subcategories of {{cl|CS1 tracked parameters}} ::{{code|lang=css|.cs1-prop-year-range-abbreviated {}|}} – {{cl|CS1: abbreviated year range}} <section end="prop_cat_highlight_help_text" />
Summary:
Please note that all contributions to UBWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
UBWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Help page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information