Template talk:Reflist/Archive 2006
From Wikipedia, the free encyclopedia
multiple columns for long lists and different appearance for zero-length lists
I think we need the script to automatically choose a multiple column style if there are a lot of sources and automatically note the need for references if there are none (but concurrently cap the number of columns at 3 or 4). Something like...
$x = min ( int ( num_of_sources / 20 ) + 1 , 4 );
if ( num_of_sources == 0 ) {
''References are needed for this article.''
}
else {
<div class="references-small" style="-moz-column-count:$x; column-count:$x;">
<references/>
</div>
}
Does anyone know how to do this? --Anthony5429 03:29, 24 October 2006 (UTC)
- Just to make myself clear...I know we could set it up to take another variable such as a number 1, 2, etc. which determines the number of columns, or we could just make a Template:Reflist2 for a 2-column reference list, reflist3 for 3-column, etc. However, I think an automatic setup would be the best so the editor simply inserts {{reflist}} and the template chooses 1 or 2 columns accordingly. --Anthony5429 04:00, 24 October 2006 (UTC)
-
- Well, it's a lot easier to do the {{reflist|2}} thing, so I went ahead and added that. There isn't a way to count references now, and I don't know if there will ever be. Also, it doesn't just depend on the number of sources, it also depends on how wide they are (100 super-wide sources should still be in one column). --Interiot 23:48, 2 November 2006 (UTC)
-
-
- Sounds great! Thanks! --Anthony5429 07:10, 3 November 2006 (UTC)
-
-
-
-
- Ahh, it looks like there are ways to have the browser automatically determine the number of columns to render. Here is an example. In that example at least, you have to give it an explicit column width. I almost always browse at 1920 pixels wide, so I like this a lot. A {{{colwidth}}} parameter could be added to make this work for reflist, if there's enough support for it. --Interiot 08:00, 3 November 2006 (UTC)
-
-
-
-
-
-
- Ohh - that is sweet. I resized the FF 2.0 window while looking at your reference list, and the column # dropped perfectly. And using CTRL++ and CTRL+- to change the text size, the column # also functions perfectly. CSS3 rules - I am all for this. Do we need to start having people vote on the change or just make the change and see if anyone disagrees? --Anthony5429 16:02, 3 November 2006 (UTC)
-
-
-
-
-
-
-
-
- If we are going to go through w/ the change, we would want to do it ASAP so that we don't have to keep backwards support for {{reflist|2}}. If we wait too long, we'll get a bunch of articles that use {{reflist|2}} and then we'll feel it necessary to keep support for the column # variable, thereby violating the KISS principle. If no one disagrees on this talk page in the next hour, I am going to go ahead switch the code to use Interiot's feature. --Anthony5429 16:40, 3 November 2006 (UTC)
-
-
-
-
-
-
-
-
-
-
- I don't think there's any problem with keeping {{reflist|2}}... we have many many pages that use fixed-two-columns even without reflist, it's the tried and true way, and I imagine editors will continue to want that. We can make auto columns coexist with fixed columns by making the auto-column syntax be something like {{reflist|colwidth=30em}}. --Interiot 17:09, 3 November 2006 (UTC)
-
-
-
-
-
-
-
-
-
-
-
-
- Okay - I will go ahead and make the change, but keep the compatibility for {{reflist|2}}. --Anthony5429 17:14, 3 November 2006 (UTC)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Alright - job's done and it seems to work fine! --Anthony5429 17:27, 3 November 2006 (UTC)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- For what it's worth, my vote is to make the default just be single-column, not auto-column. Most uses of references "in the wild" seem to be 1 column (though maybe this is because it's the historical default and not everyone has firefox). Also, auto-columns isn't well-tested and may be slightly buggy (is it just me, or if you click on a reference link, and before releasing the mouse button, all the numbers at the end of the list seem to change....) (also, the long URL in #4 at Britney Spears#References renders a little badly at certain browser widths). See User:Interiot/reflist and User talk:Interiot/reflist for the way I was thinking of. Also, it sort of assumes that all references are going to be 30em wide, which may not always be appropriate, eg. Britney Spears, so at the very least it should be possible to specify a width. --Interiot 17:39, 3 November 2006 (UTC)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- I see most of what you're saying. You can go ahead and make the change to what you're suggesting (I don't think I know the code for your suggestion). However, a couple notes: 1. I don't get the bug you have with the changing numbers - are you using google toolbar? 2. In the event that css changes to wrap long strings, I think we should consider making the auto-column-width the default. --Anthony5429 19:27, 3 November 2006 (UTC)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Okay, I made the change. I think each individual page should probably have stylistic control over whether multiple columns are used or not. For instance, the auto-35em columns didn't look very good on a 1920px browser on crankcase, not because of column width, but because the 7 total references ended up creating a grid 5 wide and 2 high, which IMHO looks weird.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- I might be open to defaulting to ~32em but allowing it to be overidden to something else, as long as it's at least tested more. Going from a feature that isn't used anywhere to being the default behavior is moving a bit too fast.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- (about the buggy behavior... I'm not using Google toolbar. As far as I know, I'm using an almost-stock v2.0 Firefox. Though it tends to only happen with 4 or 5 columns, so maybe it needs a wider screen to be seen) --Interiot 20:02, 3 November 2006 (UTC)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- All sounds good. I think it is fine the way it is now. --Anthony5429 23:03, 3 November 2006 (UTC)
-
-
-
-
-
-
-
-
-
-
-
Benefits
Hi, Anthony! Apart from the (currently unavailable) column-splitting feature, and, of course, saving a few keystrokes, what are other benefits of using this template? Any reason why it should not be substituted? Just curious. Thanks.—Ëzhiki (Igels Hérissonovich Ïzhakoff-Amursky) • (yo?); 13:41, 25 October 2006 (UTC)
- No other reasons - those are the two reasons I had in mind. I personally think it's a lot easier to type and a lot more eye-friendly to see:
== References ==
{{reflist}}
- than:
== References == <div class="references-small"> <references/> </div><noinclude>
- or:
== References == <div class="references-small" style="-moz-column-count:2; column-count:2;"> <references/> </div><noinclude>
- And of course, if we make the reference section easy to put in, it encourages the users who do not typically cite their sources. --Anthony5429 15:12, 25 October 2006 (UTC)
-
- Sounds fair. You've got a convert.—Ëzhiki (Igels Hérissonovich Ïzhakoff-Amursky) • (yo?); 16:24, 25 October 2006 (UTC)
-
-
- You've got more than a single convert; today marked the point where {{reflist}} was used on more than 1000 pages. While {{reflist}} isn't significantly less complex when used with its default parameters, the various {{cite …}}/<ref>/<references> tags are on the whole too complex, and any little thing that can be done to help simplify them seems to be welcomed. --Interiot 19:42, 5 December 2006 (UTC)
-
Section editing screwed up
I noticed that this includes a section edit link in articles, but this edit link misleadingly leads to the template. This can cause trouble if, say, one wants to add categories and the references is the last section of the article. Would including the noeditsection tag be helpful so we can avoid this problem? Johnleemk | Talk 20:42, 11 December 2006 (UTC)
- Are you seeing this on specific articles, or all of them? The only edit link I can find (using monobook, windows, firefox 2.0) leads to the section in the article that reads:
== References ==
{{reflist}}
- Or are you saying that we should remove that edit link, because it's not useful? --Interiot 20:58, 11 December 2006 (UTC)
-
- Ah, never mind. This is a problem with Template:Ref-list, not Template:Reflist. Sorry, my mistake. Johnleemk | Talk 21:06, 11 December 2006 (UTC)
- Gah, there's Template:Reflist (from Oct 06), Template:Ref-list (from Aug 06), and Template:Reference (from Jun 06)... attack of the clones. Unfortunately the other two are different in that they include the ==References== header... however, they have a total of 16 pages that use them, so perhaps we could update those pages to include a separate ==References== header, then redirect the two templates to this one, since this has 1300+ backlinks? --Interiot 21:34, 11 December 2006 (UTC)
- Ah, never mind. This is a problem with Template:Ref-list, not Template:Reflist. Sorry, my mistake. Johnleemk | Talk 21:06, 11 December 2006 (UTC)
-
-
- Also, apparently __NOEDITSECTION__ is a page-level tag, and putting it inside Template:Ref-list would remove all edit links for pages that transclude it, so that probably wouldn't work. --Interiot 21:52, 11 December 2006 (UTC)
-

