- This topic has 3 replies, 2 voices, and was last updated 3 years, 2 months ago by
David.
-
AuthorPosts
-
January 23, 2023 at 3:29 am #2505596
Stefanie
Hi there,
somewhere in this forum (unfortunately i can’t find the thread again) i read that you are not supposed to copy/paste the GB blocks. I think it has something to do with an ID that each block gets assigned automatically.
What i do very often: i go to the 3 dot menu in the editor and choose “copy all blocks”. Then i create a new page and copy the content from the clipboard into it. I do this to save me a plugin (duplicate-page or similar).
Before i worked with GB, i always found this extremely handy! Now i’m worried that i can’t do this procedure with GB blocks anymore. Is that the case? Is there an alternative to copy pages quickly?
Thank you!
StefanieJanuary 23, 2023 at 6:52 am #2505834David
StaffCustomer SupportHi there,
if you copy and paste to a new page, then GB won’t refresh the classIDs. So both pages will have blocks with duplicate classIDs.
However this in itself doesn’t cause an issue.
An issue arises if a page on the front end has duplicate blocks that were given different styles.
This can happen if I:1. edited a Page and Copied a GB Block
2. created a Block Element eg. a Page Hero or a Footer and pasted my copied block into the element.
2.1 Made a style change to that block.
2.2 set the Block Element to display on the page i copied the block from.What happens then, is both blocks get loaded with the same classID and whichever blocks CSS got loaded later would affect both.
In this example i would make a duplicate block.
So as long as a copied block isn’t being shown on the same page as its original eg. via an Element or a Widget area then there should be no issues.
If you find yourself reusing a lot of block content you created, then you may be interested in GenerateBlocks Pro which has a Local Pattern Library for you to save them to. And those can be added anywhere without any issues.
January 24, 2023 at 2:28 am #2506840Stefanie
Thank you David, now i know where the pitfalls are!
If I understand you correctly, the ID is not identical when duplicating blocks, only when copying, right?January 24, 2023 at 5:34 am #2507033David
StaffCustomer SupportThats correct, if you Duplicate a block it will always regenerated the ID.
-
AuthorPosts
- You must be logged in to reply to this topic.