We had a need to input citations in completion each time, so the document would look like this

Paragraph paragraph paragraph[fn]Some long winded citation, pp 281(59):38 x.[/fn]
Paragraph paragraph paragraph[fn]Another very long citation[/fn]
Another paragraph, we just repeated the 1st citation - but it is exactly the same, literally[fn]Some long winded citation, pp 281(59):38 x.[/fn]

Since we don't specify value attributes, there is no way to link the citations together. There are 100s+ of citations entered in this way, so going back and reordering by value wasn't an option. I've attached a patch to 2.3 that makes this possible. If the previous literal footnote is found in $store_matches, we set the $value to the $value returned by _footnotes_helper_find_footnote().

Would appreciate testing and review! Here is a sample text block that I tested with:

<p>Citation 1, no value set [fn]Zuczek, DT 1[/fn]</p>
<p>Citation 1, no value set [fn]Zuczek, DT 1[/fn]</p>

<p>Citation 10 - value set [fn value="10"]Some citation here.[/fn]</p>

<p>Citation 2, no value set [fn]Zuczek, DT 2[/fn]</p>
<p>Citation 2, no value set [fn]Zuczek, DT 2[/fn]</p>
<p>Citation 3, no value set [fn]Zuczek, DT 3[/fn]</p>
<p>Citation 3, no value set [fn]Zuczek, DT 3[/fn]</p>
<p>Citation 4, no value set [fn]Zuczek, DT 4[/fn]</p>

<p>Citation 10 [fn value="10"][/fn]</p>
<p>Citation 10 [fn value="10"]Text that shouldn't be shown[/fn]</p>

<p>Citation Auto - 1 [fn]Autonumbered Citation 1[/fn]</p>
<p>Citation Auto - 2 [fn]Autonumbered Citation 2[/fn]</p>
<p>Citation Auto - 3 [fn]Autonumbered Citation 3[/fn]</p>

<p>Backreference Citation 10 [fn value="10"][/fn]</p>

<p>Backrefence Zuczek, DT 2[fn]Zuczek, DT 2[/fn]</p>

If you try this code out, the identical citations should reference one citation instead of being created individually.

CommentFileSizeAuthor
#1 footnotes.module.diff1.15 KBdjdevin

Comments

djdevin’s picture

StatusFileSize
new1.15 KB

where did my patch go...here it is

hingo’s picture

Thank you. Initially I thought of footnotes remaining very simple, but I guess this is a logical next step in its evolution. As long as we don't mess up the simple use cases, I have no problem adding also more advanced stuff like this.

Just to confirm, and also to point this out to other readers: I assume you are aware of the Biblio module which provides this functionality but through a more complex mechanism (and is only relevant for citations, not if you actually add your own comments in the footnote).

I intend to do another footnotes release during my summer vacation. I'll be looking at this patch more closely then too.

hingo’s picture

Version: 6.x-2.3 » 6.x-2.x-dev
Assigned: Unassigned » hingo
Status: Needs review » Fixed

Hi djdevin

Thank you for the patch. I first thought this would be a complex addition to the code, but it is really simple and well separated, so I like it.

I made this feature an option, because someone could actually want the opposite behavior and anyway I don't want to break backward compatibility. (For instance, an article could have many footnotes just saying [fn]ibid.[/fn] that would still be unrelated to each other.

So to enable this feature you have to go to the Input format / Configure tab. This is mentioned in README.txt.

This is now committed and will be in the next release.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

djdevin’s picture

Thank you, sounds great!