SimpleTOC doesn’t work well with GenerateBlocks
-
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.
- https://ww.wp.xz.cn/support/topic/post_permalink-not-working-anymore/
- https://ww.wp.xz.cn/support/topic/simpletoc-problem-with-generateblocks/
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
DOMDocumentto parse and re-serialize the entire block HTML to addidattributes 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,DOMDocumentencodes them, making the tag unrecognisable by GenerateBlocks’ Dynamic Data engine.Unfortunately, we cannot change
DOMDocumentor 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 SupportI 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.
You must be logged in to reply to this topic.