• Hi Marc,
    using Simple TOC with GenerateBlocks 2.1 Headings: seems again not to set IDs on the headings. Could you check it? Maybe GB made again some changes to the code form 2.0 to 2.1 that may need to be updated in Simple TOC.
    Thanks for your support!

    • This topic was modified 9 months, 1 week ago by Claus Pescha.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Claus Pescha

    (@taruk)

    I found that it only needs an adjustment in the following line of the plugin code:

    if (isset($block[“blockName”]) && ($block[“blockName”] === “core/heading” || $block[“blockName”] === “generateblocks/headline”) && isset($block[“innerHTML”]) && isset($block[“innerContent”]) && isset($block[“innerContent”][0])) {

    Change “generateblocks/headline” to “generateblocks/text” and the GenerateBlocks headlines will be recognised again.

    Plugin Author Marc Tönsing

    (@marcdk)

    I am currently on vacation. Maybe someone can provide a pull request on GitHub and adds (not changes) the new condition after testing.

    I have to add something here. I tried your workaround, and I found one special case when it doesn’t work.

    This works only for GenerateBlocks with the integrated icons, not with custom icons. If I put a custom icon in the GB heading block, it creates wrong anchor links (like #_clip1 or #a).

    Thread Starter Claus Pescha

    (@taruk)

    @asurus: interesting, but I can’t replicate this issue on my installation. It works correct also with custom svg icons and using icons has no impact to the anchors at all. (newest Plugin Versions: GB Pro, SimpleTOC).

    I use the free version of GenerateBlocks (also the newest version). Are you using the asset library for your custom icons?

    Also, the structure of the elements looks different in the console. This is the one with the custom icon (it has “#_clip1” inside):

    <g clip-path="url(#_clip1)"><path d="M74.904,113.237c0,-18.474 16.781, (....) -22.101 7.267,-22.101Z"></path></g>

    The integrated icon look like this:

    svg aria-hidden="true" role="img" height="1em" width="1em" viewBox="0 0 496 512" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M248 8C111.03 (...) 0-64-28.71-64-64s28.71-64 64-64 64 28.71 64 64-28.71 64-64 64z"></path></svg>

    I found out what cause the issue.

    The anchor wasn’t setting correctly because of a clipPath-Element in the svg.

    Some design programs are adding clipPath (or clip-path), something like that:

    <clipPath id="a">
        <path d="M75 0h362v512H75z"/>
      </clipPath>
      <g clip-path="url(#a)">

    In my case I just could remove that part, and my SVG icon design stayed intact, and it is working now with SimpleToc.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘SimpleTOC + GenerateBlocks 2.1: again not setting IDs’ is closed to new replies.