Frontend editing menu items and page names

Dear bb-Team, dear Justin

Your product is really great - the plugin and the theme (and the support). With your software my customer should be able to manage their website without ever seeing or touching the wordpress backend. The only thing that makes the backend still necessary is editing the menu items (rename or adding new pages) or adding a new page to the site. Is it anyhow possible to: (1) add a new page (2) rename a new page (3) add or delete a page from the menu, all from the frontend within the builder?

I think this would be a really great benefit for your builder. Hope you’ve already considered this idea or could give me a hint how I could have done it on my own.

Thanks

  • Dominic

Hey Dominic,

Thanks for the kind words!

Is it anyhow possible to: (1) add a new page (2) rename a new page

This would probably be out of the scope of what the builder is meant to do. Instead, I would recommend creating a button within the custom edit bar on your sites that creates a new page and launches the builder. You could have it link to something like Website Hosting - Mysite.com and then look for the $_GET[‘new-page’] variable in your code. If it’s set, you can use the wp_insert_post function to create a new page and them use wp_redirect to send them to the post with the ?fl-builder variable set so it is launched.

add or delete a page from the menu

I’m not sure when it will be added to core, but the ability to work on menus in the customizer is being worked on.

I hope that helps!

Justin

Hey Justin

Thanks a lot for your answer. I found the following plugin that enables working on the menu in the customizer: https://wordpress.org/plugins/menu-customizer/ The plugin is still in a alpha development but already does a good job.

Dominic

Hi Dominic,

I’m working on yours baldverheiratet.com similar but for small businesses.
I need also delete, rename or adding new pages from customizer.

Do you found a soliton ?

Hi Ozan,

The WordPress core team is working on getting menu management into the Customizer. I’m not 100% sure, but that might be coming in 4.3. You can have a look at the feature plugin for that here…

https://wordpress.org/plugins/menu-customizer/

Justin

Thank you Justin,

Menu-customizer does the good job for add, edit existing pages or reordering navigation.
I need delete, rename or adding new pages from builder. My plan is do not show the wp-admin area to my customers. Just customizer and builder link in wp-admin-menu.

I made a button for fl-builder-bar named create new page linked to www.mysite.com/?create-new-page.
And I added this code to my child-theme’s functions.php

if (isset($_GET['create-new-page'])) {
 	$new_page  = array( 'post_title'     => 'My Page',
                   'post_type'      => 'page',
                   'post_name'      => 'my-page',
                   'post_content'   => '',
                   'post_status'    => 'publish',
                   'comment_status' => 'closed',
                   'ping_status'    => 'closed',
                   'post_author'    => 1,
                   'menu_order'     => 0
                  );

 	$new_page_id = wp_insert_post( $new_page );
  wp_redirect(  get_permalink($new_page_id)."/?fl_builder"   );
  exit();	
 }

And its done :))

But now I need to edit current page’s title and slug and delete current page inside the builder.

Could you please guide me how can I do this ?

Hi Ozan,

Unfortunately, it would take quite a bit of programming to build the interface and logic for editing post attributes on the frontend, so I don’t have anything that I can share. You may consider hiring someone from Codeable.io if that’s beyond what you are capable of doing.

Thanks,
Justin

Thank you Justin.

I handle delete page with get_delete_post_link function.

$delete_link = get_delete_post_link(get_the_ID());
<a class="fl-builder-delete-page-button fl-builder-button" style="display: inline;" href="<php echo $delete_link; ?> ">Delete Page</a>

I just have to figure out how to edit page title and slug :slight_smile:

Hi Ozan,

You’ll need to build out an interface with fields for accepting the title and slug. Once you have that you can use wp_update_post to update that information.

I hope that helps! :slight_smile:

Justin

Hi Justin.
I made it with hack the edit post page with JS, and opened edit.php inside the fl-lightbox. Here is the screenshot.

I know this is very wrong way to do it, but when I have time I try to do it right.

Thanks a lot.

Hi Ozan,

That’s great to hear! Let us know how it turns out :slight_smile:

Justin