Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Steps to reproduce:
- Enable totop option.
- Enable minimun elements.
The totop link is showed on content that dont have the minimun elements that TOC needs to be enabled.
Comment | File | Size | Author |
---|---|---|---|
#13 | 3084718-13.patch | 1.38 KB | lunitin |
#3 | 3084718-3.patch | 1.4 KB | flocondetoile |
Comments
Comment #2
flocondetoileHello
Thanks for reporting. I will give a look soon.
Comment #3
flocondetoileThis should fix the issue. Alse I reverse the logic "Hide the TOC if notenough elements visible".
Now the TOC is hidden by default, and is shown is there is enough elements visible in the TOC.
Thanks for your review
Comment #4
renguer0 CreditAttribution: renguer0 as a volunteer commentedHi there, thanks for your answer.
I see that back-to-top with patch applied didn't shows nowhere, plus the title of TOC is showed when there isn't headings on articles.
Comment #5
renguer0 CreditAttribution: renguer0 as a volunteer commentedComment #6
flocondetoileWhat is the TOC's title you are talking ? wouldn't that be by chance the title of the block? And no the TOC heading ?
Comment #7
renguer0 CreditAttribution: renguer0 as a volunteer commentedForget it. Clean installation of the module solved this issue, sorry for misinformation.
BTW I see that TOC is rendered (and hidded by css if conditionals not triggered). Maybe could be great if TOC only renders when conditionals occurs.
Thanks again for your time flocondetoile.
Comment #8
flocondetoileI believe that this issue is not yet fixed, until this patch is committed
Comment #9
renguer0 CreditAttribution: renguer0 as a volunteer commentedComment #10
renguer0 CreditAttribution: renguer0 as a volunteer commentedI can confirm that it don't work, patch brokes some things that works in release without patchs.
Comment #11
flocondetoileit break what ?
Have you some errors in your console ?
Comment #12
lunitin CreditAttribution: lunitin commentedThis patch works for visibility, but there is a small logic bug. According to the Table of Contents settings, when the minimum selectors is set to 0 the table of contents will always be shown. However, the new conditional will only trigger show if minimum > 0.
Comment #13
lunitin CreditAttribution: lunitin commentedComment #14
flocondetoileGood catch @lunitin
Comment #15
renguer0 CreditAttribution: renguer0 as a volunteer commentedI've to apply the patch manually because "git apply PATCH" gives this:
BTW I'll try the lastest modifications.
Thanks for your time.
Comment #17
flocondetoileThanks everyone. committed.