Can you please provide an option to enter footnotes using square bracket syntax instead of ? Many other filters do this (eg. insert view) and the reason is that with a WYSIWYG editor you can easily insert square brackets. You could use a syntax like [fn|text of the footnote]. Just have a look at the syntax of other filters in the filters section of Drupal modules.
I noticed discussion about TinyMCE integration here http://drupal.org/node/90105. Personally I use FCKeditor. I think the simplest solution to integrating both editors, and any other editors, is just to switch to square brackets notation.
To avoid breaking existing sites, the syntax used could be provided as a choice in the configuration options.
Comments
Comment #1
fletchgqc commentedSorry, the first line should read: Can you please provide an option to enter footnotes using square bracket syntax instead of
<fn>?Comment #2
beginner commentedIt is a reasonable request. We could keep both notations, for backward compatibility.
Do you have a patch that works for you, so that we can test it?
Comment #3
hingo commentedThanks for the tip fletchgqc! I didn't understand why many filters use brackets, but TinyMCE and FCK support is a good reason already.
I'll look into this first thing at the next time I have time to spend on Footnotes. Which may happen in July... For the last months I've focused entirely on this URL filter bug #161217: URL filter breaks generated href tags, but it is done now, there is nothing for me to do other than to see if anyone actually cares to commit it :-)
Comment #4
mike_foe commentedHi hingo!
I really like your footnotes module! I would be really happy if you could implement FCKeditorsupport as fletchgqc pointed out, as it is widely spread.
Much appreciated!
Comment #5
fletchgqc commentedHave just stumbled upon this module, which appears to offer the same functionality - http://drupal.org/project/citation_filter. You could steal their code to do the filtering. On the other hand you might like to evaluate the difference between your modules. According to http://drupal.org/node/201559 they also allow "linkless references". Perhaps one of the modules could be abandoned and all efforts focussed on the other module?
Comment #6
beginner commentedWell, the citation_filter module shouldn't have been started if indeed the functionality is the same. This (footnotes) module is much much older than the other one. It was stable and well maintained well before the other project started. The maintainer of citation_filter module maintainer should have looked a tiny bit harder before duplicating the work.
Comment #7
hingo commentedI already exchanged emails with the citation_filter creator. I just want to add a note here that the idea for citation_filter did not come from the creator of the module but was proposed in the Drupal tasks in Google Highly Open Participation contest: http://code.google.com/p/google-highly-open-participation-drupal/issues/...
Just to make sure no one is blaming the creator, whom we hope to be friends with for a long time. (Yes, there is a chance to merge.)
Comment #8
tobyman commentedIt would be awesome if we could get this footnote module to work properly with FCKeditor.
Looking forward to it.
Comment #9
hingo commentedJust in case someone else is thinking of making a patch, I'll move to discuss implementation strategies.
After some days of thinking, I feel the following approach is probably the most straightforward.
1) Move the current html filter to using square brackets wherever currently angle brackets are used. So
<fn> -> [fn]etc...2) Maintain backwards compatibility (forever) by keeping support for the angle brackets too
3) In documentation and user interface "hints", promote the use of square brackets.
4) In practice, this just means editing the regexps from
<fn> to <fn>|[fn](etc...)5) No modifications to output needed (for this feature)
Comment #10
fletchgqc commentedThanks Hingo,
I had a bit of a look at the syntax of the other square-bracket filter modules. I think the proposed syntax fits in well.
[fn]this is the footnote text[/fn].
Now I'm going to insert the footnotes: [footnotes].
Comment #11
tobyman commentedJust to let you know I've replaced line 101 with the following:
$text = preg_replace_callback('|\[fn](.*?)\[/fn]|s', '_footnotes_replace_callback', $text);This allowed me to used the
[fn]...[/fn]instead of<fn>...</fn>.Just this one line was changed.
Comment #12
mike_foe commentedThe best solution that provides also downwards compatibility would be not to replace line 101, but simply ADD tobyman's alteration.
Then you can have even a combination of these two types in the same text.
Great, it works for me as well!
Comment #13
hingo commented@michael: Yes, that is what I intend to do too. (Not add the line but add [fn] into the regexp.)
If no one else does it before that, I'll do this during my vacation in July.
Comment #14
rjerome commentedAs it turns out, preg_replace_callback() can take an array of strings as the first argument, so you can to something like this to match either type of tags...
Ron.
Comment #15
hingo commentedI have now added support for the square bracket syntax and just committed it. It is available in a moment in the 6.x-dev development snapshot (which is quite safe to use, as there is no heavy development going on, this is it).
The 6.x development snapshot can also be used with Drupal 5.x and 4.7 no problems.
Comment #16
hingo commentedForgot: If you download and try it, please provide feedback here so I can safely issue a formal release too.
Comment #17
hingo commentedComment #18
CarbonPig commentedHi,
This is some great dialogue. Has anyone successfully implemented a button on FCK that allows you to enter a footnote - similar to a weblink - where you can simply highlight some text, hit a button on the fck editor, and then enter the footnote info (title and URL would be perfect) in a popup? Then - upon node view it would show the footnotes...
??
Thanks ahead of time,
CarbonPig