Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beaver Builder Default Template Option #375

Open
pixelloop opened this issue Jul 17, 2024 · 0 comments
Open

Beaver Builder Default Template Option #375

pixelloop opened this issue Jul 17, 2024 · 0 comments

Comments

@pixelloop
Copy link

Is your feature request related to a problem? Please describe.

When I hand a website over to a client, some pages use BeaverBuilder and some use Beaver Themer as a fall back template. Not all pages justify having a bespoke layout and doing things this way makes it easier to make global design changes at a later date.

Currently, if a user creates a new page or they decide to do more with an existing page which means they will need a more unique layout and the use of Beaver Builder, when they turn it on, they are presented with a blank page which simply gets the content from the classic editor and adds it to a text box.

This isn't the most intuitive user experience and often leads to clients making a page which doesn't look consistent with the other pages.

Describe the solution you'd like

I'm proposing there should be a way to set a default editable template which resembles the Themer layout they are replacing. The only addition to this is that it would still grab the classic editor text and put it into a text editor.

This would allow the user to turn Beaver Builder on and have a consistent hero area at the top, a content section with consistent padding etc and from there they can iterate and build on that template.

Describe alternatives you've considered
For the last 5 or 6 years I have been using the below code, which works, but it has an annoying limitation.

// Uses the add_meta_boxes_{post_type} hook for given post type
// change page in hook to your post type where you want this to happen

add_action( 'add_meta_boxes_page', 'page_default_content' );

function page_default_content( WP_Post $page ) {
// Add the meta data fields you want the custom post type to grab
$page_meta_data = [
'_fl_builder_data_settings',
'_fl_builder_draft_settings',
'_fl_builder_draft',
'_fl_builder_data'
];

foreach ( $page_meta_data as $meta ) {
// Using a 'template' with ID of 11549
$data = get_post_meta( 11549, $meta, true );
add_post_meta( $page->ID, $meta, $data );
}
}

The above PHP does the job, but if you launch a site and then go and make changes to the template, it strangely gets the old version when you go to use it on a new or existing page.

If anybody has a solution, feel free to share. Otherwise, I'd love if this could be baked into Beaver Builder in the future, maybe it could be turned on in the settings.

I think this would really help bridge an age old gap with using Beaver Builder and Beaver Themer together with a bespoke theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant