Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Can I suggest that footnotes are not displayed in teasers - or perhaps give webmasters the option of being excluded. They are, in my view unnecessary to get a flavour of the full node and make the teaser look untidy.
Thanks
Comments
Comment #1
hingo CreditAttribution: hingo commentedHi
This has been suggested and discussed before. While I kinda understand the proponents, last discussion ended by them failing to convince me :-) (See http://drupal.org/node/87226#comment-453455)
Note that the Drupal filter architecture is such, that Footnotes doesn't know whether it is working on a teaser or a full article. That's why there is no clean way to do what you want. If there was, I sure would have done it.
To get what you want, you could use Excerpt module: http://drupal.org/project/Excerpt and In Drupal 6.0 you have the same functionality built in. This will annoy you a little bit, because you need to copy-paste the teaser text into a separate box, but you get the result you want.
It would also be possible to use CSS to not show any footnotes in the teasers (even if they were generated by Footnotes), but unfortunately the themes that are available don't seem to provide any class attributes to make such a trick possible. In effect, you'd have to hack your Drupal theme code to output a new div for identifying the frontpage, then use
.teasers .footnotes {display: none;}
to hide footnotes from teasers. This is a relatively clean solution, apart from the need to modify your theme php code. (I can elaborate on this solution if you want, but for now I'll stop here.)I'll close this, because it will not be implemented. But feel free to continue discussing the issue if you want.
Comment #2
david@thrale.com CreditAttribution: david@thrale.com commentedThanks for the reply. In most nodes I can put the fn after the <--break!> which works. However a handful need this after a few words. Thanks for a great module anyway!
Comment #3
physiotek CreditAttribution: physiotek commentedhere's what i did:
1. modified the module to add a div:
2.created a new theme file:
footnotes_div.css
3.called the new file from node.tpl.php only if a teaser:
4.enjoy!
of course it'S only hidden; the processing load/time is still there... but it works!
Comment #4
hingo CreditAttribution: hingo commentedpht3k:
Why add a div? Why not just have
...directly? Other than that, quite clever. Considering that the filter api doesn't give any info on whether you are in a teaser or not, this is probably the cleanest way there is to do it. (But since you modify node.tpl.php, it couldn't be included in the module itself, just to be clear.)
Btw, I'm a bit surprised to find out this is still an issue. Apparently there are many of you that would really prefer the footnote to go away automatically, rather than use the option of writing a separate teaser, which is easy in Drupal 6.
Comment #5
physiotek CreditAttribution: physiotek commentedmaybe because i am not a php nor a css guru hehe ;)
btw i am still on D5 and yes i do prefer to dont have to care about writing a separate teaser.
Comment #6
defconjuan CreditAttribution: defconjuan commentedYeah, I did something similar. On my theme's node.tpl.php page, I added the following code:
Comment #7
asb CreditAttribution: asb commentedThanks for the theme hack from #6 - it works beautifully on D6/Pressflow 6.16.
...but I'd really love to have this as default behaviour in a future version of the 'Footnotes' module.
Comment #8
hingo CreditAttribution: hingo commentedasb: The change in #6 needs to be done in your theme, it cannot be done in Footnotes.
What you really want to do is not the above footnotes specific change, but just something like:
Of course, in your template there probably already is a div, where you should just add the "teaser" class.
Comment #9
asb CreditAttribution: asb commented@hingo:
I did not mean exactly this theme hack from #6 but the general behaviour that footnotes don't show up in teasers at all, under no circumstances, never ever ;) (that's what this issue initially was about). And yes, I've read that you couldn't be convinced in earlier discussions (#1; "won't fix" status of this issue). So I'm simply happy that there's a working and simple hack.
I'm not sure what would be wrong with the hack from #6 - it does what it's supposed to do...?
Greeting, -asb
Comment #10
versdoc CreditAttribution: versdoc commentedAnother way to hide through css if you list node teasers throug the views module.
On you view config page add CSS class in Basic settings section. Smth like "footnotes-hide". Thereafter add to style.css of your template this class .footnotes-hide ol.footnotes {display: none;}.
Thats all and no php :)
Comment #11
mtrahan CreditAttribution: mtrahan commentedI just installed Footnotes (3 years after previous post) and I was wondering what would be the easiest way to achieve this result today? The module comes with "Footnotes with Views" and description says precisely that it: "Add views support to the footnotes module by allowing you to cut the footnotes from the rest of the body (or teaser)." I can't seem to get this working. And have yet to find documentation about it. Any help appreciated. Thanks!
Comment #12
Jonathan_WTo fix this issue, I simply added the following to my style.css file:
That removes the footnotes from both teasers and blocks.
Comment #13
stevep CreditAttribution: stevep commentedIn Drupal 7 another solution (which requires more diligence when updating node text), is to edit the summary, copying all that is desired to show in the teaser, from the node body including all [fn] .. [/fn] inserts, and placing [footnotes] at the bottom of the teaser, so that a footnotes section is seen, but is restricted only to footnotes in the teaser.
The full node defaults to normal behavior (taking note to delete "<"!--break--">" if any were previously set), so that in either teaser or full node, a footnotes section is seen and each includes all links and footnotes pertaining to that view.
Actually updates aren't a problem -- I simply edit the full node text, then copy all the text needed for the teaser including all the [fn] .. [/fn] inserts, and paste directly over what was in the summary section previously, above the [footnotes].