• Hi, footnotes is a great plugin with loads of options.

    I’m wondering if there is a way to move the backlink symbol at the end of the footnote text?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Contributor pewgeuges

    (@pewgeuges)

    @acka

    There are two ways to achieve an experience close to what you are requesting:

    1. Click at the bottom of the footnote in the table cell under the number, that should be hyperlinked all over if footnotes are not combined.
    2. Enable hard links, then hit the backbutton instead. The backlinks are required only in case the plugin works with jQuery, while with real links, the browser takes care of the scrolling back. Hard links are also what keeps the plugin working on AMP pages.

    Appending backlinks at the end perhaps requires changing parts of the processing code and was never considered because personally I hated appended backlinks, and that was a reason why I opted for the footnotes plugin over any other that I tested through. Footnotes seemed to me the best available, and at no moment I thought that appended backlinks might actually be preferred. Now I see that I was wrong, sorry please.

    Hopefully the current developers will add an option for appended backlinks, referring to your topic. But I think that you may already build a template with appended backlinks and put it into the template stack documented in the plugin, at least in older versions. Updates do not override templates stored in a sibling folder.

    Please let us know if you experience trouble with designing your custom template for the reference list body table row.

    Thread Starter acka

    (@acka)

    Dear pewgeuges,

    Thank you very much for your quick reply. I understand that people prefer backlinks next to the number of the footnote over appended backlinks. However, it would be great to be able to chose the position of the backlink.

    Unfortunately, I didn’t unsterstand the two ways suggested by you. Could you explain them in more detail?

    Thank you very much in advance!

    Plugin Contributor pewgeuges

    (@pewgeuges)

    @acka,

    No problem. In the first way I considered that after reading a longer footnote, it is tedious to scroll up to click on the number yielding the backlink, Therefore, singular footnotes do not require to do that, as the backlink extends over the whole margin before the footnote due to the table cell containing the number. Hovering the bottom left, the mouse cursor gets the pointer shape hinting a link.

    The other way of improving user experience is to enable hard links in the related setting on the plugin’s options page. Originally added for AMP compatibility, hard links also allow using the backbutton instead of clicking backlinks. The added benefit is that the browsing history won’t get crowded with clicks on internal hard links. There is also an option hinting the keyboard shortcut of the backbutton in Chrome, in a plain tooltip on hovering a backlink.

    If you keep preferring appended backlinks, please let us know.

    Thread Starter acka

    (@acka)

    Dear pewgeuges,

    Thank you very much for your explanation, now I got it. I’d still prever to have the option of appended backlinks. This would make footnotes the best footnote plugin by far!

    Plugin Contributor pewgeuges

    (@pewgeuges)

    @acka,

    No problem. Thanks for your feedback! Please paste the following code into a new file at wp-content/plugins/footnotes-custom/templates/public/reference-container-body.html:

    <tr class="footnotes_plugin_reference_row">
    	<th
    		scope="row"
    		id="footnote_plugin_reference_[ [post_id] ]_[ [container_id] ]_[ [note_id] ]"
    		class="footnote_plugin_index pointer"
    		onclick="footnote_moveToAnchor_[ [post_id] ]_[ [container_id] ]('footnote_plugin_tooltip_[ [post_id] ]_[ [container_id] ]_[ [note_id] ]');"
    		><[ [link-span] ]
    			role="button"
    			tabindex="0"
    			class="footnote_plugin_link"
    			[ [hard-link] ]
    			>[ [index] ][ [terminator] ]</[ [link-span] ]
    		>[ [anchor-element] ]</th
    	>
    	<td
    		class="footnote_plugin_text"
    		>[ [text] ] <span 
    			role="button"
    			tabindex="0"
    			class="footnote_plugin_link pointer"
    			onclick="footnote_moveToAnchor_[ [post_id] ]_[ [container_id] ]('footnote_plugin_tooltip_[ [post_id] ]_[ [container_id] ]_[ [note_id] ]');"
    			>[ [arrow] ]</span
    		></td
    	>
    </tr>

    Then open the plugin’s settings page and, under ‘Footnotes numbering’, set ‘Combine identical footnotes’ to No because with a template we can do it properly only for uncombined footnotes. Else if you are fine with having both the number and the arrow both at footnote start (in the table cell) and at the end, then you may wish to add the following template in the same folder as above and with the file name reference-container-body-combi.html:

    <tr class="footnotes_plugin_reference_row">
    	<th
    		scope="row"
    		class="footnote_plugin_index_combi[ [pointer] ]"
    		[ [event] ]
    		>[ [backlinks] ]</th
    	>
    	<td
    		class="footnote_plugin_text"
    		[ [event] ]
    		>[ [text] ] [ [backlinks] ]</td>
    </tr>

    Please let us know which template solves the problem best, if at all.

    Edit: Apologies for forgetting the issue with double brackets, as you see it in the email alert. Please remove all spaces in [ [ and ] ].

    • This reply was modified 2 years, 8 months ago by pewgeuges.
    • This reply was modified 2 years, 8 months ago by pewgeuges.
    • This reply was modified 2 years, 8 months ago by pewgeuges.
    • This reply was modified 2 years, 8 months ago by pewgeuges.
    Thread Starter acka

    (@acka)

    Dear pewgeuges,

    Thank you very much for your quick reply. I’m not using the option to combine footonotes, so the first template will do.

    However, it does not work. Under “wp-content/plugins/” I created a new folder “footnotes-custom” with the subfolder “templates” and another subfolder “public” in which I created a new file “reference-container-body.html” with your code.

    I also tried the second template by creating a new file “reference-container-body-combi.html”. This does not work either.

    Do you know where the problem is?

    Plugin Contributor pewgeuges

    (@pewgeuges)

    @acka,

    As I did test both templates before posting, the only issue of concern I can see is my failure to guess the right template among the nine possible. Hence these questions: Does your website support AMP? Is the script mode plain JavaScript in the Reference container settings? Do you display the backlink symbol appended, or in an extra column? All these options use other templates than the two above.

    Thread Starter acka

    (@acka)

    Dear pewgeuges,

    regarding your questions: I’m not using AMP. The script mode is jQuery. I display the backlink symbol appended to the number of the footnote without an extra column.

    I hope this helps.

    Plugin Contributor pewgeuges

    (@pewgeuges)

    Dear acka,

    Excuse-me please for not considering this before, as accounting for the appended symbol option only requires to copy or rename the template reference-container-body.html to reference-container-body-switch.html.

    I’ve just tested it, it works.

    Thank you for this support topic and for providing us with valuable insight in user preferences!

    Thread Starter acka

    (@acka)

    Dear pewgeuges,

    In the plugin folder there is already a file called “reference-container-body-switch.html”. So I delete this file and rename the file “reference-container-body.html” to “reference-container-body-switch.html”?

    If I do so, the backlink changes from after the footnote number to before the footnote number. However, I want to have the backlink after the footnote text.

    Plugin Contributor pewgeuges

    (@pewgeuges)

    @acka,

    Sorry for not being clear. The renaming is not in the footnotes/ plugin folder but in the footnotes-custom/ templates folder. What you need is the template wp-content/plugins/footnotes-custom/templates/public/reference-container-body-switch.html.

    At this point however, you may as well just turn the ‘Backlink symbol appended, not prepended’ setting off, since with the backlink at the end of the footnote text, it does not matter anymore. That is also why the template is the same. Apologies for not thinking at this easy fix.

    Thread Starter acka

    (@acka)

    This worked, thank you very much!

    One last question: What happens when I update the footnotes plugin? Will the changes be overwritten by the new version?

    Plugin Contributor pewgeuges

    (@pewgeuges)

    @acka,

    Glad it works, no problem!

    No it won’t be overwritten. Good question however since I happened to suggest a fix right in the plugin’s code, confident that it would be backported by the developers. But the custom template stack that you created is safe and will not be affected by any plugin update, as it is located in its own sibling folder.

    Thank you again! Be sure to reach out as soon as you require any further assistance.

    Thread Starter acka

    (@acka)

    Thanks a lot!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Backlink symbol at the end of the footnote’ is closed to new replies.