Anonymous
Not logged in
Talk
Contributions
Log in
Request account
Rest of What I Know
Search
Editing
Help:CS1 errors
(section)
From Rest of What I Know
Namespaces
Help page
Discussion
More
More
Page actions
Read
Edit
History
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; display: block" class="cdx-message cdx-message--warning"> {{int:Previewnote}} <span class="mw-continue-editing"> [[#editform|→ Go to editing area]]</span> 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]]). 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]]). </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 the next section ({{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. After (error and/maintenance) messages are displayed, it might still not be easy to find them in a large article with a lot of citations. Messages can then be found by searching (with Ctrl-F) for "(help)" or "cs1". 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 begin 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 |no-tracking=y}} 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-interwiki-linked-name {}|}} – author, contributor, editor, interviewer, translator name(s) linked to another language Wikipedia ::{{code|lang=css|.cs1-prop-interproj-linked-name {}|}} – author, contributor, editor, interviewer, translator name(s) linked to another MediaWiki project ::{{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 Rest of What I Know are considered to be released under the Creative Commons Attribution-ShareAlike (see
Rest of What I Know:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, 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.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Wiki tools
Wiki tools
Special pages
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs