You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create universal sections that can be dragged onto the editor as blocks and then edited on any page and updated to the database with the same content on every page.
I kind of have it working the way I want, based on an example that was given somewhere in this forum. But the issue is that when the editor is reloaded, it duplicates the instance in the source code. I can only tell it's duplicating because I wrapped it in a div to identify it, and I see the submission logs in console submitting it multiple times.
What I'm trying to accomplish is to identify the section when I write the page file, and then do a php string replace to insert the section on the page from my mysql block_data table.
Can you suggest a better way to get the content of the section and write it to the page so I don't have to rely on the duplicating div tags?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to create universal sections that can be dragged onto the editor as blocks and then edited on any page and updated to the database with the same content on every page.
I kind of have it working the way I want, based on an example that was given somewhere in this forum. But the issue is that when the editor is reloaded, it duplicates the instance in the source code. I can only tell it's duplicating because I wrapped it in a div to identify it, and I see the submission logs in console submitting it multiple times.
What I'm trying to accomplish is to identify the section when I write the page file, and then do a php string replace to insert the section on the page from my mysql block_data table.
Can you suggest a better way to get the content of the section and write it to the page so I don't have to rely on the duplicating div tags?
Duplicates like this:
Here's my code:
Beta Was this translation helpful? Give feedback.
All reactions