• Resolved edit4ever

    (@edit4ever)


    Is there a way to hide the heading text if the content is empty? Some of our posts don’t have the H2 and H3 blocks that we use to generate the TOC – but the heading text still appears.

    • This topic was modified 10 months ago by edit4ever.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Marc Toensing

    (@marcdk)

    hi, I don’t the SimpleTOC in that page. If a heading is there it will appear in the toc.

    Thread Starter edit4ever

    (@edit4ever)

    The sample post uses the same template as all of our blog posts. The Simple TOC block is on the left side. You will see the Simple TOC header text “Table of Contents” followed by the list of headings (which are empty on this post) – when a post has headings – it looks like this:

    https://hydrolix.io/blog/scientiamobile-integration/

    But on posts where there are no headings – the header text from the Simple TOC block still appears. The request is that if the post has no headings (Simple TOC ul/li are empty) then it should not write the Simple TOC header text on the block.

    Plugin Author Marc Toensing

    (@marcdk)

    Okay but it links to the 3 headings that are all visible and available on that page. I opened it first on mobile, sorry.

    Thread Starter edit4ever

    (@edit4ever)

    Yes – this post shows how it works normally: https://hydrolix.io/blog/scientiamobile-integration/

    This post shows that it still shows the header text even though there are no headings on this post: https://hydrolix.io/blog/how-elkjop-stopped-ddos-attack/

    The second one is where Simple TOC should not be showing the header text text since the post has no headings to include in the TOC. “Table of Contents” is the header text generated by Simple TOC.

    Thread Starter edit4ever

    (@edit4ever)

    Should I put this in the github as a suggestion? It seems like more of a default that is needed in order to not show the block header text when the TOC will be empty.

    Plugin Author Marc Toensing

    (@marcdk)

    I tried this. With default settings the SimpleTOC block does not output anything if there are no headings.

    Please try and make an empty article and add only SimpleTOC. It should display nothing.

    Thread Starter edit4ever

    (@edit4ever)

    Did you fill in the header text for the Simple TOC block? That’s the item that is being output.

    Plugin Author Marc Toensing

    (@marcdk)

    did you set a custom title? What happens if you disable that custom title and leave the default?

    Thread Starter edit4ever

    (@edit4ever)

    It says Table of Contents as the default. If I try to erase it – it automatcially fills in Table of Contents.

    If I click remove heading – it goes away – but it goes away for all pages.

    • This reply was modified 9 months, 3 weeks ago by edit4ever.
    • This reply was modified 9 months, 3 weeks ago by edit4ever.
    Plugin Author Marc Toensing

    (@marcdk)

    please remove and readd the SimpleTOC block with just its defaults and report is the headline disappears?

    Thread Starter edit4ever

    (@edit4ever)

    Replacing a new Simple TOC block on a new template page causes the same issue with the Header Text of “Table of Contents” to appear even when there are no headings in the post.

    Thread Starter edit4ever

    (@edit4ever)

    Here is a simple query loop of current posts – with a title block and then the Simple TOC block. You can see the first post has headings and shows the header and headings in the TOC block.

    The second post has no headings in it – but the TOC block header still shows up.

    View post on imgur.com

    Plugin Author Marc Toensing

    (@marcdk)

    Is the screenshot from the same page or is this combined? Because I cannot reproduce this. With default settings (!) the headline does not appear if there are no headings.

    Thread Starter edit4ever

    (@edit4ever)

    Thank you for your time investigating this. I am traveling this week – but when I return I will setup a clean wordpress test site to test this and report back to you.

    That way I can weed out some other config or plugin conflicting.

    • This reply was modified 9 months, 3 weeks ago by edit4ever.
    Thread Starter edit4ever

    (@edit4ever)

    Just wanted to provide an update. We werte finally able to track down the issue – turn out there was a hidden Headings block in our post template that was causing the issue.

    The plugin works as expected. Thank you again for your time helping us!
    Please considered this resolved.

    Great plugin!!

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Hide heading text if content empty’ is closed to new replies.