Module talk:Footnotes
This doesn't work properly in Template:Sfn
Please see Template talk:Sfn#Lua version is broken. --Redrose64 (talk) 22:43, 2 April 2013 (UTC)
Broken parameter
Please see Template talk:Harvard citation no brackets#Broken parameter. Similar templates are probably similarly broken. Wtmitchell (talk) (earlier Boracay Bill) 07:13, 28 April 2013 (UTC)
- This should be fixed. Dragons flight (talk) 10:18, 28 April 2013 (UTC)
More than six parameters
It would help if the code was more compatible with CS1. At the moment it does not handle more than four authors elegantly. See Module talk:Citation/CS1#CITEREF and harvnb and CITEREF and CS1. -- PBS (talk) 13:09, 21 December 2013 (UTC)
Markup
The Lua CS1 templates strip markup, such as bold or italics, where this module does not. Thus if markup is used in {{sfn}} or variant, then the link and anchor will not match. -- Gadget850 talk 11:28, 6 March 2014 (UTC)
Protected edit request on 27 June 2014
This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
Module:Citation/CS1 runs mw.uri.anchorEncode()
on options.id
before generating the <span id="
... line. For compatibility between generated id
in that module and the #CITEREF
generated here, I think this change needs to be applied on this module.">
(Here is an example footnote which is not linked to it's citation and I think it's because of the above mentioned problem.) Dalba 07:38, 27 June 2014 (UTC)
- Done Thanks for the fix! — Mr. Stradivarius ♪ talk ♪ 12:15, 27 June 2014 (UTC)
Template:sfnp
{{sfnp}} could usefully be implemented within this module as well as {{sfn}}. As far as I can see, function f.sfnp( frame )
would simply duplicate function f.sfn( frame )
with the addition of:
args.bracket_year_left = "(";
args.bracket_year_right = ")";
An oddity at present is that |postscript=none
works for {{sfn}} but not for {{sfnp}}. Peter coxhead (talk) 20:21, 15 December 2014 (UTC)
- It does in a sort of round-about way:
{{sfnp}}
calls{{Harvard citation/core}}
calls Module:Footnotes function harvard_core().
- Is
|postscript=none
necessary for{{sfnp}}
? The code seems to indicate that{{sfn}}
uses '.' for a default of postscript character. If|postscript=
is empty or omitted, then{{sfnp}}
uses an empty string as the default postscript.
References
- So as a CS2 user, I end up with
{{sfnp|ps=|...}}
but would prefer|ps=none
for same reason as you (well, actually I'd prefer another template, and did once create one, but the consensus was to delete it). - Doing things in a "round-about way" is a sure recipe for software errors (at least that's what I used to teach in first-year software engineering). The complexity of the current code is shown by the fact that it isn't easy to work out what {{sfnp}} actually does. A separate function is clearer and easier to maintain. Or perhaps better still (because more modular), pass appropriate parameters to
f.sfn()
. Peter coxhead (talk) 21:13, 15 December 2014 (UTC)
- So as a CS2 user, I end up with
- Right, it gets it's postscript from the template call to
{{Harvard citation/core}}
. Module:Footnotes tweaked and I tweaked your example.
- Right, it gets it's postscript from the template call to
- You'll get no argument from me in support of round-about code. Every line must be maintained. I'll think about integrating
{{sfnp}}
in the module.
- You'll get no argument from me in support of round-about code. Every line must be maintained. I'll think about integrating
- Ok, tweaked
{{sfnp/sandbox}}
to pass the bracket defaults as|bracket_year_left=(
and|bracket_year_right=)
tof.sfn()
in Module:Footnotes/sandbox where those parameters override the defaults normally used by{{sfn}}
:- Some text using
{{sfnp}}
.[1] - Some text using
{{sfnp/sandbox}}
.[2] - Some text using
{{sfnp/sandbox|ps=none}}
.[3]
- Some text using
- Ok, tweaked
References
- A much more elegant approach than the current version; hopefully soon to be deployed. Peter coxhead (talk) 18:56, 16 December 2014 (UTC)
- Done.
Dashes and hyphens, oh my
A number of threads have shown up on WT:VPT (e.g. WP:VPT#Help in fixing a "cite error") and elsewhere regarding the change in MediaWiki to output an error where the same names are used in a reference but where the reference is defined differently.
It seems to me that a basic level of checking for that could be implemented in this module, either (namely) to treat (example) |p=
and |pp=
the same before outputting the reference for Template:sfn or to do some basic level of sanity checking e.g. where |p=
uses a dash/hyphen (and should not) or where |pp=
doesn't use one of the set: (,|-)
(or similar).
Thoughts? --Izno (talk) 17:17, 14 November 2015 (UTC)
- Only that there's a need to be careful not to exclude electronic publications which increasingly have "page" numbers with non-numerical characters in them. Peter coxhead (talk) 17:26, 14 November 2015 (UTC)
- My suggestion would be only to look for certain punctuation. --Izno (talk) 17:40, 14 November 2015 (UTC)
- And then do what once the detector detects whatever it is set to detect?
- My suggestion would be only to look for certain punctuation. --Izno (talk) 17:40, 14 November 2015 (UTC)
- This is difficult.
|p=A-1
or|p=17-6
are legitimate page numbers.
- This is difficult.
- Precisely. Peter coxhead (talk) 22:05, 14 November 2015 (UTC)
Auto-formatting dashes in parameter "pages"
Module:Citation/CS1 based templates automatically replace hyphens (-) with endashes (–) when hyphens are typed in the |pages=
parameter. Is it possible to implement this feature into this module?
Αντιγόνη (talk) 07:24, 28 September 2016 (UTC)
- Yes, we can do that here if there is sufficient support for it. If we do add it, I would like to see us adopt some sort of mechanism that allows editors to override the auto-conversion. Elsewhere I suggested a couple of ways that this might be accomplished. Those proposals were not taken up.
- —Trappist the monk (talk) 10:40, 28 September 2016 (UTC)
- So what would happen with something like
|pp=A-1–A-15
? Entirely possible with electronic publications. Peter coxhead (talk) 14:15, 28 September 2016 (UTC)- Which is why I suggested
|pp=((A-1–A-15))
or|pp=A--1-A--15
as ways to tell the module to 'do it this way': pp. A-1–A-15. - —Trappist the monk (talk) 14:48, 28 September 2016 (UTC)
- Well, either there has to be some special mechanism, as you suggest, or no automatic replacement, which I prefer. Peter coxhead (talk) 15:24, 28 September 2016 (UTC)
- Which is why I suggested
- So what would happen with something like
Last change broke date=n.d.
Please add a condition in function core to avoid adding the ampersand before the date when date=n.d.: {{harv|Author|n.d.}}
results in (Author n.d.) . 72.43.99.146 (talk) 00:30, 18 October 2016 (UTC)
- Amendment: even though it should be obvious anyway, I should have stated that any iteration of an undated reference gets similar treatment ("undated", "no date" etc.) since the module thinks that these are author names. 72.43.99.146 (talk) 00:40, 18 October 2016 (UTC)
test cases
Hi. I've just run the test cases against some small changes to the code in the sandbox, with lamentable results. I reverted my changes and the test cases still fail. Is this expected? Alternatively, should I copy the main code into the sandbox to ensure that the sandbox code is up to date? I don't want to damage anyone else's work. Regards, Martin of Sheffield (talk) 22:40, 21 August 2017 (UTC)
- The
{{sfn}}
tests have never 'passed' as far as I know because two{{sfn}}
templates with identical input parameters must be separately distinguishable from each other else the back-links won't work. Two instances of the same template:{{sfn|brown|red|orange|2017}}
- produce:
<sup id="cite_ref-FOOTNOTEbrownredorange2017_1-0" class="reference"><a href="#cite_note-FOOTNOTEbrownredorange2017-1">[1]</a></sup>
<sup id="cite_ref-FOOTNOTEbrownredorange2017_1-1" class="reference"><a href="#cite_note-FOOTNOTEbrownredorange2017-1">[1]</a></sup>
- I suspect that the values used in the comparison made by the test code are the values of two stripmarkers:
?'"`UNIQ--ref-0000000A-QINU`"'?
?'"`UNIQ--ref-0000000C-QINU`"'?
- Stripmarkers are replaced with actual content long after the template and module code has run.
- —Trappist the monk (talk) 09:48, 22 August 2017 (UTC)
Page needed
Have recent changes to this template caused the use of {{page needed}}
as a value for the parameter "p=" caused a break. If so it has broken many pages. See for example this edit (Revision as of 09:56, 2 February 2017) mentioned in this section Talk:Second Boer War#Fixing style/layout errors.
- {{sfn|Haydon|1964|p={{page needed|date=February 2017}} }}
- [1]
References
- ^ Haydon 1964, p. [page needed].
If so please revert the and discuss how to fix it, as the change as this will have broken many pages, and the fix of placing page needed outside the short citation is not appropriate. -- PBS (talk) 20:03, 7 December 2017 (UTC)
- No recent changes. Last change was 18 September as you can see from the history. What is interesting is that if you were to rewrite that example without a date, it appears to function correctly.
{{sfn|Haydon|1964|p={{page needed}} }}
[1]
References
- ^ Haydon 1964, p. [page needed].
- Something mysteriously wrong with
{{page needed}}
? - —Trappist the monk (talk) 21:20, 7 December 2017 (UTC)
{{Page needed}}
needs a date (a bot will added it). It seems to work now, so (as always) as we do not use version numbers the broken text no longer shows an error. So for the record/archive what was fixed? -- PBS (talk) 19:54, 10 December 2017 (UTC)- This; described here.
- —Trappist the monk (talk) 03:13, 11 December 2017 (UTC)
- Thanks. For the record now the above is now archived: Wikipedia:Village pump (technical)/Archive 161#Either Template:Sfn or some subtemplate of it appears to be broken. -- PBS (talk) 18:41, 18 December 2017 (UTC)
Logic error in handling of "n.d."
The conditional statement in lines 70-72 ("prevent double periods when date is 'n.d.'
"). It forces |ps=none
("then args.postscript = "
). Please fix. 108.182.15.109 (talk) 13:26, 19 June 2018 (UTC)