Topic on Project:Support desk

"MediaWiki:Cite references prefix" no longer exists -> how to add headline to citations?

7
Summary by Stefahn

Needs to be done via jQuery for example, see thread.

Stefahn (talkcontribs)

I use <references /> in a template for all my articles. If there's at least one reference in the wikitext, the references are shown and via MediaWiki:Cite references prefix a headline was shown for the references. This worked fine in MediaWiki 1.27.

Now I updated to MediaWiki 1.31 and I found that MediaWiki:Cite references prefix no longer exists. What is the new equivalent to it?

Extension:Cite doesn't say anything about it.

MarkAHershberger (talkcontribs)
Stefahn (talkcontribs)

Thanks. I tried <references responsive="" /> but it doesn't change my code. I get <div class="mw-references-wrap mw-references-columns"> with <references /> as well.

Also, <references responsive="" /> doesn't add a headline and the task says nothing about "MediaWiki:Cite references prefix"...

MarkAHershberger (talkcontribs)

The change to implement this also removed the cite_references_prefix key.

The comment on the commit contains this bit:

* Deprecate cite_references_prefix/cite_references_suffix.

This message is rarely used and opens up compatibility hazards. It was already removed by Parsoid, but the PHP implementation still had it. It's typically used to add inline styles to the wrapper which is more appropiately done in Common.css (or obsoleted as part of the skin or Cite extenion itself nowadays depending on what style in question). It was also a HTML-style message with separated open and close segments, which is an anti-pattern in itself.

Stefahn (talkcontribs)

Okay, thanks for the info.

Any suggestion how I can add a headline automatically if there are references in the wikitext? I could do via jquery's before but that feels like a hack...

MarkAHershberger (talkcontribs)
Stefahn (talkcontribs)

Okay, thanks.

I used this code now in my Common.js and it works fine:

$(document).ready(function(){
    $('.mw-references-wrap').before('<h2>References</h2>');
});
Reply to ""MediaWiki:Cite references prefix" no longer exists -> how to add headline to citations?"