Extension talk:Cite
Contents
| Thread title | Replies | Last modified |
|---|---|---|
| HTML5-style syntax? | 1 | 02:04, 10 May 2013 |
| Cite does not create references | 9 | 07:23, 14 April 2013 |
| Cite failing to render citations | 0 | 22:23, 12 April 2013 |
| Number of references | 4 | 16:45, 7 March 2013 |
| Mimic Wikipedia's Cite | 12 | 18:43, 4 March 2013 |
| Allow defining references not used in page text? | 0 | 06:48, 26 February 2013 |
| Rename the extension | 1 | 21:52, 20 February 2013 |
| Error after installing Cite extension | 1 | 23:15, 19 February 2013 |
| "Fatal error: Call to undefined function wfmessage()" | 4 | 21:46, 18 January 2013 |
| page-argument in ref-tag | 0 | 12:32, 16 January 2013 |
| memcache + cite does not work? | 0 | 02:54, 10 January 2013 |
| Can't download | 3 | 14:28, 6 November 2012 |
| How to disable Cite for summary pages? | 1 | 23:18, 18 October 2012 |
| Tooltip | 1 | 11:40, 22 August 2012 |
| 2 bugs were found. | 0 | 06:34, 12 August 2012 |
| Template expansion WITHIN a ref? | 2 | 15:51, 24 July 2012 |
| I get nada | 1 | 09:46, 6 June 2012 |
| How are the automatic list columns created? | 1 | 18:35, 25 May 2012 |
| Cite and Vorlage:Literatur | 0 | 20:32, 7 May 2012 |
![]() First page |
![]() Previous page |
![]() Next page |
![]() Last page |
Cite.php syntax is not compatible with HTML5; this is an issue for consistently using HTML5 in MediaWiki – see mw:HTML5.
Cite.php uses XML-style syntax for “empty/void elements” – <ref name="foo" /> and <references /> – in a way that is not compatible with HTML5; the XML-style is from XHTML 1.0. This is not necessarily a problem per se, as these are Tag extensions, not actual HTML/XML tags, but as the web moves to HTML5, this will be a cause of inconsistency and confusion to users unless corrected. Further, it requires the MediaWiki software to support inconsistent syntax.
The easiest solution is probably to use templates to insulate users from the details of the tag syntax; this is detailed below.
Contents |
Issue [edit]
The issue is that in HTML5, the minimized tag sytax <foo/> is invalid for non-void elements, and is generally interpreted simply as a tag – <foo> – the trailing slash (/) is stripped, rather than interpreted as a terminator. As the Cite.php tags are non-void (they can have content), this is interpreted as a bare opening tag, without a closing tag.
Thus instead of XHTML <ref name="foo" /> and
<references />
in HTML5 one would need <ref name=foo></ref name=foo> and
<references></references>
(note that HTML5 allows unquoted attribute values).
Because the ref and references tags are very widely used (notably on English Wikipedia), this issue has very broad scope, even if the impact is minor.
Background [edit]
The details are confusing; here is some background.
XML allows minimized tag syntax <foo/> for empty elements (see XML: Tags for Empty Elements and XHTML1: Empty elements). In XML, “empty element” means “has no content, whether or not element type declared with keyword EMPTY (meaning ‘cannot have content’)”, so it refers both to elements that cannot have content, such as <br> (usually serialized as <br/> where the slash is a terminator, but can be serialized as <br></br>) and elements that can have content, but do not, like an empty paragraph: <p></p>.
Per HTML5 “Elements” documentation: HTML5 “void element“ means “cannot have content”; it corresponds to XML’s EMPTY keyword. Further, trailing / are dropped (formally the slash is actually forbidden for non-void elements). This changes behavior for empty non-void elements. Void elements only have a single tag, where the / is optional, as in <br> though <br/> is also valid. Empty non-void elements, like empty paragraphs, need a closing tag (though this may be implied in some cases). For example, <p/> in HTML5 does not behave like <p></p> (an empty paragraph) as in XHTML, but it’s invalid syntax, and generally instead acts as bare opening tag: <p>.
Proposal [edit]
The <ref name="foo" /> syntax is tricky, but the <references /> should be easy to handle. The use of the {{reflist}} template – which always (can?) output <references>...</references> – means that users are insulated from this. Further, <references></references> has the same behavior whether it has content or not: it includes any references in its content and lists pending inline refs.
The <ref name="foo" /> syntax is trickier because there are two behaviors for the <ref name="foo"> tag: create a new named ref (which is non-void), or refer to an existing ref (which is void, or handled by “if empty, then…”). At the tag level, clearer is to separate these, say by <ref name="foo">...</ref> followed by <ref2 name="foo"> to create and then refer to a named reference.
This would be easier if this issue were isolated from users via a template. At English Wikipedia {{ref}} is already used for a separate type of referencing, but {{fn}} (for “footnote”) is an almost unused template, so it could be used, and would be consistent with the {{sfn}} and {{efn}} template names. Using this, users could write {{fn|name=foo|...}} and then {{fn|name=foo}} later.
In more technical detail, the existing XML-style tags could be supported indefinitely, or deprecated then removed, with an automated migration tool. The tool would:
- Replace
<ref name="foo" />by<ref2 name="foo">(leave quotes as they are allowed) – or even by{{fn|name=foo}}and - Replace
<references />by<refererences></refererences>– or even by{{reflist}}
Summary [edit]
In summary:
- Authors should use templates:
{{fn}}and{{reflist}} - Behind the scenes, add
<ref2>tag and migrate existing usage.
How does this overall approach sound?
I've already elaborated on HTML5#HTML in wikitext why HTML5 is irrelevant to stuff inside the Parser.
MediaWiki: 1.19.2
Snapshot of the Cite: for MediaWiki 1.19.x
So, I installed the Cite and added require_once to LocalSettings.php
Now I'm trying to repeat the example:
According to scientists, the Sun is pretty big.<ref>E. Miller, The Sun, (New York: Academic Press, 2005), 23-5.</ref>
The Moon, however, is not so big.<ref>R. Smith, "Size of the Moon", Scientific American, 46 (April 1978): 44-6.</ref>
== Notes ==
<references />
and I get the folowing:
According to scientists, the Sun is pretty big.<cite_reference_link>
The Moon, however, is not so big.<cite_reference_link>
Notes
<cite_references_prefix><cite_references_link_one> <cite_references_link_one><cite_references_suffix>
What's wrong?
Those snapshots are unreliable, as I experienced myself lately. Try downloading the extension through Git instead.
Yeah, now I got the Cite extension by:
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Cite.git
Replaced the previous one by that new one. But yet that has not changed anything, unfortinatelly. There are still <cite_reference_link> instead of footnotes.
Any further suggestions, please? I'm desperated with this extension, it didn't work that way since I had MediaWiki 1.17.
Maybe a recent change messed things up? You can try older versions of the extension, also available through Git:
https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Cite.git;a=summary ("snapshot" gives you a download link)
Nope, it didn't help too. I also tried snapshots of the Cite from 1.10 to the last 1.19 - none of them works correctly, all behave like I described.
Weird though - it actually does some work: translates <ref></ref> into <cite_reference_link>, but it seems that something messes with it.
I read somewhere, that some web-hosters have some "features" or "settings" on their servers, that prevents some extensions from working correctly. It seems that I'm the only one with such problem, and that means the problem is on my side, not on the extension's.
OMG, I've found the reason - I guess, it's my stupidity.
I've read once again the Cite's page here and saw the text where it says about special names or I don't know how to name it. So, it's like I described earlier: I got some <cite_references_prefix><cite_references_link_one> <cite_references_link_one><cite_references_suffix> instead of references.
I simply went to the Wikipedia's special pages and copy source from there to special pages in my wiki, and it worked. For example, I went to my page MediaWiki:Cite_references_link_one and pasted there <li id="$1">'''[[#$2|↑]]''' $3</li>. And so on.
I'm so glad, that everything works just fine now.
Product Version MediaWiki 1.20.3 PHP 5.3.23 MySQL 5.3.12
On the version page, cite is verified, but after trying to use it, it doesn't seem to want to generate citations. Any idea as to what might be going on here? Please help. Thanks!
Current behavior
According to scientists, the Sun is pretty big.<cite_reference_link> The Moon, however, is not so big.<cite_reference_link>
Notes
<cite_references_prefix><cite_references_link_one> <cite_references_link_one><cite_references_suffix>
Is there a way to get the number of references on a page? I am trying to get the ref-list to automatically appear on pages but I don't want it to appear if there are no references being used.
This should be relatively easy (and chpeap) to do through javascript (granted, readers with JS disabled will miss this feature).
i do not know a way to get this data displayed on the page directly (i.e., becoming part of the page directly, through wiki-code). it may be possible via scribunto (aka lua), but this will requires you to write some code also, so the advantage over JS is not clear (except for readers with JS disabled). and i'm not even sure if it's possible (and of course, if possible, it requires installing the scribunto extension).
here is a snippet that, if added to mediawiki:common.js will display the number of references under the page title (100% untested - this is meant mainly to illustrate):
if ( ! mw.config.get( 'wgNamespaceNumber' ) ) // only in namespace 0 $(function() { var num = $('ol.references li[id|="cite_note"]').length if (num) $('#siteSub').append(' | ' + num + ' Cite notes'); });
peace.
reading the original request more carefully, my reply was not very useful.
you can still use JS to *hide* the "references" section in case it's empty, but it may not be very pretty - the section will momentarily appear, and only after the page finishes rendering it will disappear (somewhat like "collapsible" elements). it will also not solve the case where there *are* references but no <references /> section.
again, you can use a pre-save JS hook that will at least warn the user when they are going to save a page with <ref> tags but no <references/> tag. you want to be careful, and not trigger the warning when editing a section.
peace.
Actually, I have the <references /> tag on almost any page, embedded as it is in a template so that I don't have to remind myself of adding it manually. When no references are used on the page, the list simply does not appear. The only nuisance is that I can't make the subheading (e.g. "References" or "Endnotes") conditional on the presence of <ref>...</ref> tags. The subheading appears regardless.
Is there a process so that I could mimic Wikipedia's Cite extension?
I downloaded and installed the Cite extension, to test it I copied a page from Wikipedia onto my wiki. I ended up getting errors about nonexistant Cite groups and missing Templates. I began to copy Cite Templates from Wikipedia to my wiki and now I get a Fatal Error timeout.
different wikis (such as enwiki) wrap the references with templates. if you want to use this extension in the simplest way, do not use any templates, but rather use the tags: the cites themselves appear on the page between tags <ref> and </ref>, and then, somewhere on the page (customarily at the end), you also need a <references /> tag (i.e., a self-closing "references" tag).
once you get this to work, you can start to play with more advanced features, and specifically with the "name" and "group" attributes.
peace
Thank you for your response. I have the Cite extension working, but when I try to mimic Wikipedia I begin to get problems.
you can move (i.e., copy) templates from enwiki to your site, but you want to pay attention to some things:
- there are other extensions installed in enwiki. specifically, Extension:ParserFunctions, which some templates depend on.
- enwiki templating is pretty complex, and many templates use other templates. if you want to pull a template from enwiki, you need to pull (recursively) all the tempalates that this template uses.
peace.
Ah I see. One of the big problems was that I did not have ParserFunctions enabled. Are there other big extensions that I would need?
I am still receiving the error where Cite cannot find the name/group, but when I check the backend they are present.
Hello,
I have recently upgraded to MediaWiki 1.20 and noticed that an extension I wrote to keep track of bibliographies (Miranche/BiblioTex) was partly broken. The extension adds functionality to Extension:Cite to use BibTex bibliographic information, both provided in wiki text or stored on the local file system. The references are included in wiki text via <cite>...</cite> tags, which basically just unwrap into corresponding <ref>...</ref> tags. These parallel LaTeX usage, and accordingly I have also added <nocite>...</nocite> tags for references that I want to appear in the reference list but not in the text. Using a previous version of Ext:Cite, probably over 2 years old now, this worked no problem. Now, I get cite_error_references_missing_key.
The way I would deal with this locally would be to hack Ext:Cite to add an option, say $wgCiteAllowMissingKey, to allow for such references. I wanted to check, though,
- Is there a relevant past discussion on why references in the text are now required?
- Would an option to relax this requirement be useful in the public version of the Cite extension?
Thank you!
Hello there, i'm running MW V1.19.3, everything worked perfectly after I installed Cite extension, now i get this error x2 on every page:
Warning: Cannot modify header information - headers already sent by (output started at /.../LocalSettings.php:1) in /.../includes/WebResponse.php on line 38
And can't access to my index/home page, the error just show up seven times, please can anybody help me?
Fatal error: Call to undefined function wfmessage() in /home/wikimultiple/wikimultiple/extensions/Cite/Cite_body.php on line 1007
This happens on any page with citations. I am a rank beginner at these things. Could someone explain?
What version of MediaWiki do you use (check Special:Version), and where did you download the Cite extension exactly (what version).
I got the same error. I'm using MW 1.16.2 and tried several snapshots of this extension, always the same error. This error can be fixed by replacing wfmessage() by wfMsg() but other errors appears after that.
wfMessage() cannot be replaced by wfMsg(). wfMessage(), a global function referencing the Message class was introduced in MediaWiki 1.17. We strongly suggest you update to a supported version of MediaWiki or use an older version of Cite.
it would be nice to have somewhere a list of links to "sanctioned" versions of the extension per mediawiki version.
i guess it's enough to have links to specific git commits (just to demonstrate what i mean - something like this), because the gitweb/gerrit thingy already has a "snapshot" link that gets you the tarball ready to eat.
peace.
Are there any developments regarding the "References to different pages of same source" -problem as described in Extension:Cite/Cite.php#Criticisms except the "additional template"-solution? More specifically, any plans or efforts made to have page-argument in ref-tag? Or estimates how hard it would be to implement it so that following would be the outcome:
Page text like Argument A.<ref name="xyz" page="42-43" /> Argument B. <ref name="xyz" page="5" /> and references-tag like <references> <ref name="xyz">Details of source.</ref> </references> would produce <backlink to first citation with text like: page 42-43>, <backlink to second citation with text like: page 5> Details of source. into references-list.
Or additional note-argument which would simply add possibility to give some notes in every citation.
Hello,
i updated today my wiki+cite to the newest versions. If CACHE_MEMCACHED is activated cite doesnt parse the </ref> and tags. If CACHE_ACCEL is activated everything works fine.
I restarted memcached / flushed memcached / ?action=purge everything does not work. Why is cite and memcached not working together?
Thanks!
The download links don't work, the following error is returned:
Invalid response from remote subversion client.
I need this plugin. --95.146.10.255 18:10, 8 May 2012 (UTC)
Hi
The Webinterfaces aren't working at the moment.
I could get the files for the Cite-Extension using:
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Cite.git
Hope that helps.
Beda
How do I disable rending of [1] and the reference block on some pages? The ref-Tags are within embedded templates. But on summary pages, which embedd the same templates, the footnotes are anmoying.
one, somewhat clumsy way to do it is to add to the template a parameter, say "summary", and add the refs like so: {{#if:{{{summary|}}}||<ref> blah blah blah </ref> }}
if the summaries belong to a different namespace (many times the article will be in namespace 0, and the summary in namespace "project", or 4), you could instead add them within a test for the appropriate namespace, saving you the need to use a parameter.
it's ugly, but some of the ugliness can be hidden by using (yet some more) templates.
if there's more sophisticated way around it, i can't think of one.
Just noticed the tooltip.js on the extension. can the developers explain why they chose to ignore "tipsy", which is a jquery extension that's included in the mediawiki package, and instead chose to develop their own tooltip package? this does not make sense to me, unless there is a reason to think tipsy is somehow broken, or there is some reason to believe it might not be available on all mediawiki installations. (for a gadget that use tipsy to display reference tooltips, see w:he:Mediawiki:Gadget-CiteTooltip.js)
I have a Wiki with about 200 source documents that are cited so often that I'd like to have a template for each which opens the <ref> tag, spits out the particulars to identify the book and adds the first parameter before emitting the </ref>, e.g.: {{BellFundamentals|p. 45}} where the template would contain something like
- <includeonly><ref>Bell, Richard. ''Fundamentals of Change'', London, blah blah. {{{1}}}.</ref></includeonly>
However, the {{{1}}} parameter invocation does not expand. Is this possible in any way with Cite, or would it be possible if I rolled up my sleeves and started altering its internals? I really want to avoid typing <ref> and </ref> ever again.
For now you have to use {{#tag:ref|yadda yadda{{{1}}} }}.
I was working on a fix, but its unclear if it will get accepted.
Thanks -- solved for now. I found this, too, in a belated discovery of the archives of this page.
When I put this up: [1]
- ↑ Brenner, Michael; Frisch, Shelley (April 2003). Zionism: A Brief History. Markus Wiener Publishers. p. 184
I get this as a preview: <cite_reference_link>
<cite_references_prefix><cite_references_link_one><cite_references_suffix> ????
======== [edit]
Also,, when I try to use the snapshot thingy, I get an error message.
How are the automatic list columns of ol.references created?
I can't find the according Javascript code :/ Cheers!
this is done by utilizing a CSS3 (or is it css2?) feature called "columns". not all wikis choose to use this feature, and those that do are doing it through their css (look for "-moz-column-width", "-moz-column-count", "-webkit-column-width" or "-webkit-column-count"). it is also somewhat important to note that not all browsers support this feature - notably IE doesn't.
Hi I have started to use the template Vorlage:Literatur from de.wikipedia.org for my own wiki (http://www.muri-gries.ch/mediawiki) in order to simplify bibliographic references in footnotes.
With my current version of mediawiki a
</span>
-Tag appears at the end of each reference:
http://www.muri-gries.ch/mediawiki/index.php/Walter
In the source I see that these two tags are written:
</span>
instead of
</span>
. If I copy the text and correct it the resulting html-file is displaid as expected in the Firefox.
If I make a test on de.wikipedia.org using the source-text of my article, everything is ok too.
Where is my mistake?
Mediawiki: 1.19.0 (newly installed hoping it would solve my problem :-)) PHP: 5.3.3-7+squeeze8 (apache2handler) MySQL: 5.1.49-3
Thank you Beda
![]() First page |
![]() Previous page |
![]() Next page |
![]() Last page |



