Hi all,
Has anyone here developed footnotes with EE, like footnotes in an academic paper? If yes, would you care to share with an EE newbie how to do it? Or maybe there is a plugin or a hidden footnote feature somewhere, not stated anywhere in the documentation? I’d be really interested to know.
Thanks, Mats
Yes, that’s it. (Gruber’s way of doing footnotes has also the added benefit of not requiring JavaScript, as is the case with most solutions I’ve seen so far.)
I viewed the source code, and I think I understand how he does it. But it’s a pretty cumbersome way to implement footnotes if you have to manually hand-code each and every one this way. I honestly don’t think the contributors to my current project site is up to this challenge.
Is there a smarter and easier way to do automate Gruber’s solution with EE?
Mats
Unfortunately, Gruber’s method requires direct manipulation on a case by case basis. You might be able to accomplish this with a plugin, but it would take a fairly creative solution from an experienced PHP programmer, and would still require some training of your authors, as there will still have to be something typed in that would establish a relationship between a piece of text with a footnote. This is going to be fairly site specific as well, as your site may implement entries with a variety of custom fields for both the entry and additional fields for the footnotes and another site might have one single field for the whole shebang.
Hey guys,
When searching for solutions, I found this page with Gruber’s method translated into JavaScript. It seems simple enough, but I’m still not sure how to implement it in the Publish Form without hacking the code or creating a plugin.
As you say it would be possible to accomplish this with a plugin, but that it’d take a fairly creative solution by an experienced PHP programmer. Though I can think of some neat solutions how to do certain aspects, I don’t think I’m qualified enough to do something like this as I’m more a PHP basic guy really.
I’d really appreciate some advice here. What do you suggest? That I put this up as a feature request (which would probably be sorted out very quickly due to the fact it’s no life-or-death matter for the majority of EE users)? Or that I hire some EE expert coder to do it (that said, what’s your assessment of how many hours would be needed to create something like this)?
Thanks, Mats
Actually, Derek, I don’t think it’s nearly that complicated. Here’s a demo of a plugin I whipped up in about ten minutes. (Ignore the goofy URL.) I used Gruber’s text in this demo for comparison purposes. The relevant raw text looks like:
I've been experimenting with the use of footnotes here on Daring Fireball over the last few months.[[E.g. "Font Caches Gone Wild".]] In print, implementing footnotes is rather straightforward: put the note references in the text, then place the notes themselves in smaller type at the bottom of the pages where the references occur.
and
...This works pretty well and looks pretty good, and it solves the "how do you get back to the text from the footnote" problem concisely and quietly.[[Of course, because it's a Unicode character, the design assumes you've got a Unicode-savvy web browser and Unicode-savvy fonts installed on your system. Some users of pre-XP versions of Windows may just see a box instead of a hooked arrow. My heart bleeds.]]
As you can see, I have used [[Stuff you want in the footnote goes here]] to indicate a footnote. The plugin takes care of numbering the footnotes, and it creates an ordered list automatically. Even the custom field problem you noted isn’t actually a problem.
So…anybody got some feature requests for me?
Edit: Ahem. I see the conversation moved on without me. That’s what I get for loading this page, then going away for a couple hours, and not refreshing it when I came back. Oh well.
That’s a bit different approach then I took, Mr. Wilson, and that’s definitely an interesting way of doing it. How does your plugin determine where to place the footnotes? I decided to use a matching tag based approach (that also circumvents any issues of living in multiple custom fields), but allows you to place the footnotes anywhere you like in your template. It also works on multi-entry pages by using a unique identifier for each entry in addition to the standard footnote # in the anchor id’s.
I should note that when I say that something “would take a fairly creative solution from an experienced PHP programmer” that the adjectives in that sentence are relative to the number of posts and perceived development knowledge of the person I’m responding to. For most of our users asking for custom solutions, writing a plugin with text manipulation is a tremendous task, and I haven’t gotten to know mWall’s level of knowledge yet, so I prefer a safe reply. 😛
So you see, mWall, that there are many ways to approach a given task. Mr. Wilson’s looks good, and if you haven’t already, you could contact him about obtaining his plugin, or you can try out the one I created.
How does your plugin determine where to place the footnotes?
The footnote list is placed via a {variable}, so it can go anywhere between the plugin tags. There are also header and footer tags, in case the user wants to mark the beginning or end of the footer section with something (i.e. a line).
t also works on multi-entry pages by using a unique identifier for each entry in addition to the standard footnote # in the anchor id’s.
I hadn’t even thought of that usage. That’ll just take a minute or two to add.
Well, I have yet to strike the perfect balance in my programming of the wise words:
An engineer knows he has a perfect design, not when there is nothing left to add, but nothing left to take away.
So I end up coming up with obscure situations that my plugins might be used, and writing more code than is really necessary to handle all of those scenarios. I tried to limit that on this one, and accounting for multi-entry pages felt like a bad idea to remove.
Wow! What can I say? Not one solution but two! That’s more than one can take for one day. Thanks a lot, guys!
Now it’s getting late over here in Europe (GMT+1), but I’ll look closer into this tomorrow and try to figure out which one to use. (Ever thought of comparing notes, guys?) 😉
Anyway once again, many thanks!
Mats
P.S. @Mr Wilson, would you care to put up your plugin for download someplace, including documentation how to install and use it? Thanks. D.S.
I’ve now installed and tested Derek’s footnote plugin. And it’s working beutifully, see my working example here. I think I’ll stick to this solution since it does basically all I want it to do in a simple enough way (I think I can teach my content writers to use the {ref#} and {fn#}{/fn#} tags). And besides it’s very well documented (as usual with most EE stuff).
@Derek: This plugin should definitely be submitted to the EE plugin list. Many people who write academic papers or official documents of any kind will find this plugin very useful. Kudos to you, John Gruber and the guy at BrandSpankingNew who first came up with the Javascript.
I have a couple of other nice ideas for EE mods/plugins (including this one), but I let you rest on your laurels for a day or two. 😉
Thanks, Mats
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.