Template talk:Ref indent

From Wikipedia, the free encyclopedia

[edit] Template creation

I created this template after rethinking my original proposal to include this formatting functionality within citation templates themselves. This seems to do the job and is a simpler solution. AFAIK this template should be browser- and settings-agnostic, but the possibility remains open that it may not display as intended for some particular combination of conditions. If anyone runs across any odd behaviour, pls document here.

One circumstance where I'm unsure of what the result would be, is if used to format a multi-columned output from {{reflist}}. My browser (guess which) ignores these columns, so I don't know what it would like like in some more savvy browser that can render these columns. However, it wasn't really intended to be used in that circumstance, and I'm not sure whether there'd be a benefit anyways (as footnotes or inline cites generated by <references/> are usually quite brief anyways).

Otherwise, testing to date indicates it's working as intended.--cjllw ʘ TALK 09:08, 9 October 2007 (UTC)

[edit] Fix for Firefox browsers

The initial implementation resulted in an undesirable display in Firefox (and presumably other Gecko-based browsers), with the bullet also being indented by the set amount to appear inside the text. I think this came down to the way these browsers 'attach' the bullet to the <LI> element, instead of (like MSIE) to the <UL> container (or something like that, anyway). A fix has been implemented, so it's looking OK now in Firefox, however in MSIE the bullet now appears hard up against the text (but not overlapping with it, at least). Inserting a non-breaking space between the bullet and the text would separate OK.

Alternatively, the bullets can be dispensed with altogether by using a colon ( : ) instead of an asterisk ( * ).

The template also now seems to work in MSIE and Firefox for footnotes generated by <references/>. However, if multi-column display is used (eg {{reflist|2}}, which only works in Firefox etc, not MSIE ) there is some overlap of the text between columns, so use in these circumstances not currently recommended. --cjllw ʘ TALK 23:51, 10 October 2007 (UTC)

So, in other words, you need an MSIE specific fix :), not a Firefox one.
I think the root of the problem you describe is your 'padding-left: 0em'. IE appears to be cascading it to the child elements, i.e. to what is inside the <li>s. If this is so, there is a workaround for it. :)
Now, because you are already suggesting that there is an incompatibility with {{reflist|2}}, I suggest you integrate the functionality of your template directly into {{reflist}} and {{refbegin}}. Like this:
<div class="references-small" style="
{{#ifeq:{{{hang|0}}}|0|margin-left:1.5em|
{{#ifexpr:{{{cols|{{{1|0}}}}}} > 0|margin-left:1.5em|
text-indent:-{{{hang|5}}}em; padding-left:0em; margin-left:{{{hang|5}}}em; list-style-position:inside;
}}
}}
{{#if:{{{colwidth|}}}|
-moz-column-width:{{{colwidth}}}; -webkit-column-width:{{{colwidth}}}; column-width:{{{colwidth}}};
}}
{{#ifexpr:{{{cols|{{{1|0}}}}}} > 0|
-moz-column-count:{{{cols|{{{1|}}}}}}; -webkit-column-count:{{{cols|{{{1|}}}}}}; column-count:{{{cols|{{{1|}}}}}};
}}
">
the ifeq tests if a hang= parameter either empty or non-zero. (A hang= parameter without value defaults to 5).
the ifexpr test that cols= (or parameter #1 if cols= is empty or not defined) is > 0.
-- Fullstop 20:46, 24 October 2007 (UTC)
Hi, many thanks; I missed this post when it was first made, and have only now come across it. I couldn't quite get the suggested coding above to work when I tested it out. In any case, by my understanding of what it is trying to do, it may not make a difference to the issue on the spacing and relative positioning of the leading bullet as it appears in MSIE and Firefox. The coding which performs the indenting:
text-indent:-{{{hang|5}}}em; padding-left:0em; margin-left:{{{hang|5}}}em; list-style-position:inside;
seems unchanged from what's in {{ref indent}} at the moment. The result looks good in Firefox, in MSIE the result is no spacing between the bullet and text, which at the moment is manually overcome either by foregoing bullets, or inserting a {{nbsp}} or two. Your code might well address the other issue, which is to make the output acceptable in a multicolumn layout, but I haven't yet got it so I can try it out. Cheers, --cjllw ʘ TALK 03:53, 19 December 2007 (UTC)