• Resolved jhanten

    (@jhanten)


    Since the Support Monitor here deleted my entries in the previous topics and told me to start my own for help I am doing that here with feedback from the GeneratePress Developers. Before you just mark this as a duplication and resolve it please read on. I’m trying to help you fix the problem. Your plugin is awesome, but I am having to move away from it to launch a website so hopefully you can fix this in the future for other people.

    As stated in these other topics SImpleTOC has a problem that breaks GenerateBlocks Dynamic content.

    After reviewing the previous original topic and doing some research the Generate Block dev team reported these findings and made a suggestion for how you could fix it as I suspect this will break other plugins as well:

    The ToC plugin uses PHP’s DOMDocument to parse and re-serialize the entire block HTML to add id attributes to headings.

    This happens before dynamic tags are processed and their data is rendered.

    As a result, the HTML still contains GenerateBlocks dynamic tags with their curly braces. When these appear inside a URI attribute such as href , DOMDocument encodes them, making the tag unrecognisable by GenerateBlocks’ Dynamic Data engine.

    Unfortunately, we cannot change DOMDocument or the ToC plugin’s behaviour, making it incompatible with GB Dynamic Tags.

    More broadly; reprocessing the full HTML just to inject heading IDs is a bit heavy-handed. I would recommend that the developer investigate WP_HTML_Tag_Processor , introduced in WordPress 6.2, which avoids these compatibility issues and is a better-suited method for the task.

    I hope this helps clarify the issue.

    GeneratePress Support

    I hope this helps and gives you what you need to move forward. Thank you for being a WordPress developer. Your plugin basically is breaking, dynamic buttons, pagination links etc. in the GeneratePress echo system. As of Version 6.9.6 I would recommend anyone building sites with GeneratePress and GenerateBlocks do not use this plugin. Hopefully this will be fixed in a future version.

    Good luck to you. I’m off to remove your plugin from nearly 100 pages of two websites so I can launch them with working links.

    • This topic was modified 3 months, 2 weeks ago by jhanten.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Marc Tönsing

    (@marcdk)

    Hi, thanks for the input. It is not like someone or I did this on purpose. Of course, we can always improve the code and WP_HTML_Tag_Processor is a good hint. Since SimpleTOC is open-source and completly free it would be great if someone can provide a pull request on GitHub pages. I will take a quick look if this is an easy fix with WP_HTML_Tag_Processor but no promises.

    Plugin Author Marc Tönsing

    (@marcdk)

    Okay, i think I can replicate it. Is this the problem? Screenshot of the problem: https://ibb.co/Q7PsHJ3C

    1. I installed GenerateBlocks
    2. Added a Loop Query
    3. Inside the loop query are dynamic headlines like a template for the query as in wordpress core
    4. The whole loop appears in SimpleTOC as {{post_title link:post}}
    5. The content itself renders okay inside the post. Only the headline in SimpleTOC is “broken”.
    • This reply was modified 3 months, 2 weeks ago by Marc Tönsing.
    Thread Starter jhanten

    (@jhanten)

    I saw in your other topic you wanted to know how to duplicate this issue. and I just saw your example, but you can do something simpler because the problem is bigger than just in the loop. Since I didn’t want them to delete my reply again I’m adding the answer to my own topic. How to see the issue:

    1. Built a local site with GeneratePress theme (free version) and Generateblocks (free version)
    2. Installed SimpleTOC (current version 6.9.6)
    3. Built a page with TOC block and a few junk headers to make sure TOC was working
    4. Added in a Generateblocks button and added a dynamic link setting it to the post URL using the Dynamic Tag feature.
    5. Published the page and mouse over the button link and instead of saying the url it shows http://{{post_permalink}}/
    6. Disable SimpleTOC and the link because the correct one.
    7. A more complex option is to build a query using the Advanced Query and include pagination the previous and next buttons will not be the right URL but will be a code.

    Hope this helps.

    • This reply was modified 3 months, 2 weeks ago by jhanten.
    Plugin Author Marc Tönsing

    (@marcdk)

    it should work since 7.0.4

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

You must be logged in to reply to this topic.