Jump to content

[SOLVED] Define blocks once, share across RPB fields


FireWire
 Share

Recommended Posts

@bernhard I am almost certain that this is a repeat question but my efforts to find the original answer if it exists have come up short.

I have two RPB fields and I'd like to have all of the blocks that were created and located in the original RPB field available to the second field without replicating the block folders themselves.

Field 1 (original field): rockpagebuilder_blocks
Field 2 (additional field): rockpagebuilder_blocks_2

Thus far all of the blocks have been created in the original blocks field, I'd like the same blocks to be available to the second field. I created an empty folder for rockpagebuilder_blocks_2 as blocks_2.

image.png.d33a1e3921d98897616ff7c46de77492.png

I can't remember if this is possible or if there is a file I need to add to the folder, or rename blocks_2 to something else? I've tried renaming the folder to rockpagebuilder_blocks_2 but no dice. Does it require copying all of the blocks from one directory to another?

Thanks!

Edited by FireWire
Marked as solved
Link to comment
Share on other sites

Hi @FireWire to "clone" or "mirror" a block it just needs an empty (!) php file with the same name.

/site/templates/RockPageBuilder/blocks/Foo/Foo.php (all code)
/site/templates/RockPageBuilder/blocks2/Foo/Foo.php (empty)

  • Thanks 1
Link to comment
Share on other sites

I don't think it's very elegant, but it works ^^ I think you can also use the GUI and click on "use one of the existing blocks" after clicking on the plus to create a new block, no?

  • Like 1
Link to comment
Share on other sites

  • FireWire changed the title to [SOLVED] Define blocks once, share across RPB fields

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...