Template talk:Sfn

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by John Cardinal (talk | contribs) at 04:54, 5 March 2010 (→‎Adding a group parameter: SfnRef). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Ref param

Contrary to what the doc says, {{sfn}} does not honour the ref=/Ref= parameter. Could someone fix this please? -- 89.15.54.157 (talk) 18:01, 22 February 2010 (UTC)[reply]
ps: Could emits of {{1}} etc please also be changed to {{echo|{{1}}}}? That way any leading/trailing whitespace in the anonymous parameters would be ignored.

It's not terribly clear admittedly, but the |ref= parameter is not intended to be placed in {{sfn}}, but is used with the associated cite template - whether that be {{citation}}, {{cite book}}, {{cite journal}}, etc.
Not sure what you mean by your "ps" though. --Redrose64 (talk) 18:09, 22 February 2010 (UTC)[reply]
  1. Ref= in {{citation}} etc is not much use unless you have a matching ref= elsewhere. As, for example, in {{harvnb}} and all the other {{harv*}} templates, where Ref= works just fine and always did.
    As would be obvious to anyone familiar with sfn and the harv family, {{sfn}}'s failure to support ref= forces an editor to use <ref name="...">{{harvnb|...|Ref=...}}</ref>. Ugh.
  2. Never mind my ps. Previously, {{sfn|abc|2010}} and {{sfn| abc|2010}} did not emit the same thing. Thus my ps. Evidently, someone fixed {sfn} already. (harvnb etc are still broken though)
-- 89.15.54.157 (talk) 19:45, 22 February 2010 (UTC)[reply]
Re your #1. You can't control the ref element created by Sfn; you adjust the ref parameter of the target citation when you use Sfn with something other than author names. So, for example, {{sfn|NARA|2009}} would need a citation such as {{cite web |title=... |ref=CITEREFNARA2009 }} or (using SfnRef) {{cite web |title=... |ref={{SfnRef|NARA|2009}} }}. You can't control both ends, but you can adjust the target, and that's enough. — John Cardinal (talk) 20:01, 22 February 2010 (UTC)[reply]
What you can do is to use {{SfnRef}} (or its alias {{harvid}}) as in this example:
{{sfn|Smith|Jones|2009|p=123}}
{{cite book ... |ref={{SfnRef|Smith|Jones|2009}} }}
However this approach is not necessary if the |last1= (etc.) and |year= parameters are used in the citation template, together with |ref=harv:
{{sfn|Smith|Jones|2009|p=123}}
{{cite book |last1=Smith |first1=M. |last2=Jones |first2=G.R. |year=2009 |ref=harv }}
--Redrose64 (talk) 21:19, 22 February 2010 (UTC)[reply]
The way you guys go on you'd think someone was asking you to solve the world's global warming problems. So, I just fixed the problem myself.

Foo said "Hello".[1] Bar said "Nice weather here".[2] Foo also announced that his chickens had the pox.[1]

  1. ^ a b Foo 2010, p. 10.
  2. ^ Bar 2010, p. 11.
  • Apple, Adam, ed. (2010), "First Plenary Discussion", Xoo Conference, pp. 5–50
Nothing especially exotic. This same sort of thing would be true for any collection of snippets where the individual snippets have attribution but not their own titles. -- 89.15.54.157 (talk) 23:28, 22 February 2010 (UTC)[reply]
Re: "The way you guys go on you'd think someone was asking you to solve the world's global warming problems." See WP:DICK. — John Cardinal (talk) 00:06, 23 February 2010 (UTC)[reply]
Do you seriously hold your response (last or any other) to be constructive, receptive, and thoughtful? Or are you just having a bad day? -- 89.15.54.157 (talk) 00:58, 23 February 2010 (UTC)[reply]
My comment directly above probably won't help because you seem committed to wasting time with snide remarks rather than concentrating on communicating clearly. Lastly, my day is going quite well. I never let ill-humored remarks from strangers with a bad attitude get in the way of that. — John Cardinal (talk) 01:24, 23 February 2010 (UTC)[reply]
I'm not committed to anything but a simple answer to a simple question. To that simple question, I was told that it wasn't possible, but that I was instead to twist myself into contortions (and that too, to accomplish something that I didn't want to accomplish). Then, when I pointed out that you were going over the top, and when I made the fix myself (showing how simple it was in reality) I was told that I was a dick. Then, when I pointed out that that was not a particularly constructive thing to say, and that you must be having a bad day to say such a thing, I'm told that I'm committed to wasting time with snide remarks.
In summary: first I was told to piss off, and then told I was a dick to not piss off, and then told I'm snide and ill-humored because I spot a pot calling a kettle black. You're quite right that your calling me (or anyone else) a m:DICK "won't help"; as the page tells you, that's a pretty DICKy thing to do. But whatever. Since its unlikely that you will start reflecting on what you or I have said, and since I have what I want, I'm going to vanish now. I wish you a better day tomorrow than you had today. Ciao. -- 89.15.54.157 (talk) 02:39, 23 February 2010 (UTC)[reply]
The thing is, your original post suggested to me that you had misunderstood the documentation because it was ambiguous. Accordingly, I clarified the documentation. You didn't actually say why you wanted to use |ref= inside {{sfn}} until after you had modified the template. The thing is, we tend not to modify a high-use template like this without good reason, and we hadn't actually seen the good reason. --Redrose64 (talk) 09:44, 23 February 2010 (UTC)[reply]

<If you fellows are through and can shake hands, I'm afraid I have to point out that the ref parameter broke the template, at least in Safari. I've rolled back the changes. I tried to do it in the sandbox, but its a little beyond me. Feel free to try to finish it, but please use the sandbox. Thanks. ---- CharlesGillingham (talk) 20:55, 24 February 2010 (UTC)[reply]

Rolllback and the ref/Ref parameter

Charles Gillingham rolled back the recent addition of ref= with an edit summary that said the change broke the template in Safari. Before ref= is re-introduced, I think we should discuss it. IMO, Sfn should be as lightweight as possible, and the ref= added a bunch of parameter references and a switch statement. I don't think the usage case is very common, and the example given above produces a bad result: the short references mention author names that aren't visible in the full citation. How is the reader supposed to know which full citation is paired with the short citations? Yes, the reader can click the link to have the full citation highlighted, but that only works in browsers that support the ":target" pseudo-class, and that means IE8 users don't see the highlight. (There may be a Javascript solution for that.) Anyway, I am not sure I'd vote for adding the ref= functionality. There is a workaround: the user can use {{harvnb}} with a REF element.

If we do add ref=, I recommend that we not implement both Ref= and ref=. Pick capitalized or not, and given the other parameters are not capitalized, ref= seems preferable. — John Cardinal (talk) 01:00, 25 February 2010 (UTC)[reply]

I agree that the ref parameter is unnecessary. It actually defeats the whole purpose of the template, which is to provide standardized link names (one for the footnote and one for the citation).
A better idea for your example is use {{sfn|Foo|2010|p=10}} and {{citation| author=Foo|editor-last=Apple|editor-first=Adam|year=2010|chapter=First Plenary Discussion|title=Xoo Conference|pages=5-50}}. Of course, if you really need your own special anchor name, you can always just type <ref>[[#Foo|Foo (2010), p. 10]]</ref>. You don't really need {{sfn}} to do this and John is right, there's no reason to complicate the code and introduce errors in some browsers. ---- CharlesGillingham (talk) 04:58, 25 February 2010 (UTC)[reply]

Adding a group parameter

Is it possible to add an optional "|group=" parameter so that notes can be separated from other citations, such as journal citations. – VisionHolder « talk » 18:58, 4 March 2010 (UTC)[reply]

Have a look at Reading Southern railway station to see {{sfn}} used in conjunction with books and journals, particularly refs 25, 40, 54. --Redrose64 (talk) 19:15, 4 March 2010 (UTC)[reply]
My problem is that I have a mix of references types, as discussed here. I'd like to be able to separate out the notes from the more complete references since I'm using LDR. If you want, after reading my LDR question take a look at one of my sandboxes, and you'll see what I'm dealing with. I just figured having a way to separate out my short footnotes (which I rarely use) might help me solve 3 of my 5 situations: journal citations (under References), regular books with page citations (under Notes), and regular books with chapter citations (under Notes). – VisionHolder « talk » 19:47, 4 March 2010 (UTC)[reply]
Why not use short references for everything? There's no need to separate sources by type, and you can use a short reference for any source. — John Cardinal (talk) 20:37, 4 March 2010 (UTC)[reply]
I'm starting to play with that possibility in my sandbox, but so far I would have to say that I would prefer a "|group=" option. – VisionHolder « talk » 22:01, 4 March 2010 (UTC)[reply]
Okay... one big problem with using Sfn for everything is that many of my journal articles have up to 10 authors. When that happens, the sfn ref looks like this: {{sfn|author1|author2|author3|author4|year}}. It doesn't look like much, but since you can never abbreviate it (unless you cheat using Template:SfnRef) numerous journal citations get ugly and difficult to read. I was hoping to eliminate this by using Template:R, but that can't happen if I'm using sfn for everything. (Too bad you can put all your sfn calls in the LDR by wrapping named ref tags around them.) Simply put, citing journals is best with LDR and the Template:R, while citing books is best (usually) with Sfn. This is why I would prefer to split out the short footnotes from the journal and web references. This is why I want a "|group=" parameter. – VisionHolder « talk » 23:03, 4 March 2010 (UTC)[reply]
If you have a long list of authors, use {{sfn|author1 et al|year}} and then make the ref= value match. — John Cardinal (talk) 00:16, 5 March 2010 (UTC)[reply]

This is what I'm looking to do. I managed it by doing my own CITEREF calls. I'm not sure how usable it would be or if the layout is acceptable for a references section, but if people like it, I could easily create a Sfn2 template. It looks like it's would only require stripping out the ref tag so that you can nest in a LDR block. Anyway, tell me what you think. (When you're looking at it, just imagine a huge article with a ton of references to journal articles, web pages, and complex books. Also notice the relative simplicity of the code compared to the complexity of the sources cited.) – VisionHolder « talk » 01:07, 5 March 2010 (UTC)[reply]

I don't care for the presentation of the source information on that page. Using "Yoder et al 1996" as a short footnote, and similar solutions for the other sources, is much better. — John Cardinal (talk) 04:42, 5 March 2010 (UTC)[reply]
P.S. I have used short footnotes on articles with hundreds of citations and it works fine. Most of the sources had at most a few authors, but some had 9 or 10, and there's no problem. — John Cardinal (talk) 04:44, 5 March 2010 (UTC)[reply]
P.P.S. (Sorry about the multiple edits.) I am not sure why you think using SfnRef is cheating. Some sources do not have author names, or have more than should be listed in a short footnote, and it's not clear how to make the cite template know what value the sfn has used. it's a simple and straightforward solution, and not cheating at all. — John Cardinal (talk) 04:54, 5 March 2010 (UTC)[reply]