Home>Support>Page builder default post type layout

Page builder default post type layout

By bibbelibo, 10 years ago. Last reply by bibbelibo, 10 years ago.
Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

Hi!

Is it possible to choose a default layout created with the page builder for all posts of a certain post type? If not, are you planning on adding this functionality?

If I choose a layout for each post and later change my mind about the layout it seems I have to go through every post which is too troublesome if I have like 1000 posts..

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 10 years, 6 months ago Andrew Misplon
    Hi, I Work Here

    Hi bibbelibo

    There is unfortunately nothing like this in Page Builder or in the pipeline at the moment. You can use Prebuilt layouts to clone existing Page Builder layouts. We’ll keep your feedback in mind moving forward. Thanks for sharing it with us.

  2. 10 years, 5 months ago bibbelibo

    I was thinking something simple like hooks that lets me decide where the panels data is saved to and where it’s fetched from so that I could for instance have one row for each post type in the options table instead of one row for each post in the postmeta table.

  3. 10 years, 5 months ago bibbelibo

    This seems to be doing what I want :)

    function my_update_panels_data( $meta_id, $object_id, $meta_key, $_meta_value )
    {
    	if( $meta_key == 'panels_data' )
    	{
    		$post_type = get_post_type( $post_id );
    
    		if( $post_type == 'my_post_type' )
    		{
    			update_option( 'my_post_type_panels_data', $_meta_value );	
    		}
    	}
    }
    
    add_action( 'update_post_meta', 'my_update_panels_data', 10, 4 );
    
    function my_add_panels_data( $object_id, $meta_key, $_meta_value )
    {
    	if( $meta_key == 'panels_data' )
    	{
    		$post_type = get_post_type( $post_id );
    
    		if( $post_type == 'my_post_type' )
    		{
    			update_option( 'my_post_type_panels_data', $_meta_value );
    		}
    	}
    }
    
    add_action( 'add_post_meta', 'my_add_panels_data', 10, 3 );
    
    function my_delete_panels_data( $meta_ids, $object_id, $meta_key, $_meta_value )
    {
    	if( $meta_key == 'panels_data' )
    	{
    		$post_type = get_post_type( $object_id );
    
    		if( $post_type == 'my_post_type' )
    		{
    			delete_option( 'my_post_type_panels_data' );
    		}
    	}
    }
    
    add_action( 'delete_post_meta', 'my_delete_panels_data', 10, 4 );
    
    function my_get_panels_data( $panels_data, $post_id )
    {
    	$post_type = get_post_type( $post_id );
    
    	if( $post_type == 'my_post_type' )
    	{
    		return get_option( 'my_post_type_panels_data' );
    	}
    
    	return $panels_data;
    }
    
    add_action( 'siteorigin_panels_data', 'my_get_panels_data', 10, 2 );
    
Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More