• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

XenCarta Footnotes

Moses

Well-known member
#1
I'm considering making something in templates to handle footnotes, just posting general ideas at the moment in the hope the community here can suggest improvements to it.
 

Moses

Well-known member
#2
I think a workable solution could be done using javascript.

Basic idea is to call a template and add to a javascript array at each footnote, then display them all at the bottom.

In line with a wiki article would be footnote references such as this:

Code:
A great resource on the internet is the wikipedia[template=footnote]name = Wikipedia | url = http://en.wikipedia.org[/template]. You can often find information using google[template=footnote]name = Google | url = http://www.google.com[/template]
That would render inline like this (but with the footnotes as superscript)
A great resource on the internet is the wikipedia1. You can often find information using google2
The final piece would have to be another template call at the end of your article, say
Code:
[template=footnote-display][/footnote-display]
Which would render like
---------------------------------
Footnotes
1 Wikipedia
2 Google
 

Moses

Well-known member
#3
I'm actually getting pretty close on this now!

http://www.greenandgoldrugby.com/community/wiki/footnote-test/

Two issues, both basic HTML use but they've got me stumped.

My internal links are not working for some reason, far as I can tell they're correct, but they don't link to the place on the same page??

Xenforo is adding [url] BBCode to my links so I need to wrap them in for it to work.

[template=footnote-top][/template]
text [template=footnote-add]name = Google | url = [plain]http://www.google.com[/template] more text [template=footnote-add]name = wiki | url = http://www.wikipedia.org[/template] more [template=footnote-add]name = gagr | url = http://www.greenandgoldrugby.com[/template]

[template=footnote-display][/template]
 

Moses

Well-known member
#4
that was weird, seems I need to pass the entire URL to the href

have found using document.location + "#reference"
seems to work, unless you refresh a page such as
http://www.greenandgoldrugby.com/community/wiki/footnote-test/#fnbackref_1

then the links will point to
http://www.greenandgoldrugby.com/community/wiki/footnote-test/#fnref_2#fnbackref_1

which doesn't work.

Minor though, I'm just about ready to release this, would be nice if there was a way to avoid xenforo parsing URL bbcode onto URLs in the wiki.