New Landing How can we help? Themeforest Theme Support Dante Swift Page Builder for custom post type

Viewing 12 posts - 1 through 12 (of 12 total)
  • Posted in: Dante
  • #167166
    MsZitac
    Member
    Post count: 6

    Hello,

    I just created a small plugin which needs a special post type. Creating/editing posts in this section does not support the swift page builder. How can I manage this page builder to show up in my new post type?

    the code looks likte this:

    add_action( 'init', 'zswh_create_post_type' );
    function zswh_create_post_type() {
      register_post_type( 'my-secret-post-type',
        array(
          'labels' => array(
            'name' => __( 'MySpecialName' ),
            'singular_name' => __( 'MySpecialName' ),
          ),
          'supports' => array('title', 'editor', 'thumbnail'), //Not sure what it does, was hoping this would solve the problem
          'rewrite' => array('slug' => 'myspecialname','with_front'=>false),
          'public' => true,
          'has_archive' => true,
        )
      );
    }
    #167172
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi there,

    Unfortunately that is not part of the current theme functionality, and it’s not within the scope of our support to be able to provide that functionality as it is more work than a small customisation. While we’d love to be able to support every customisation request, we simply don’t have the time. We recommend that you seek a freelance developer if you need that functionality, potentially from one of the below resources:

    https://codeable.io

    Home


    http://studio.envato.com/

    Thanks ๐Ÿ™‚
    With Best Regards
    Mohammad

    #167213
    MsZitac
    Member
    Post count: 6

    Hello and thanks for answer.

    Is there any way to include the Page Builder if I take my plugin functionallity and implement it as a child theme?
    That is, can I create custom post types in a child theme and add the swift page builder functionallity?

    #167219
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    I am afraid that its not easy task. We need to develop a lot of code from scratch. Please hire a developer to include in Page Builder.
    Thanks
    Mohammad

    #167250
    MsZitac
    Member
    Post count: 6

    Ok, is there any documentation about how this would be done the right way? Even if I hire a dev, he or she should find documentation somewhere? Or do you mean i should hire a dev with special skills in Swift Page Builder/Dante..?

    When i build my own themes and use other layout builders, such as “Page Builder by SiteOrigin” this functionallity works out of the box.

    For me it does’nt sounds like rocket science to include the Page builder functionallity to another post type, for me it sounds like I just need to add my posttype in an post type array somewhere ๐Ÿ™‚

    http://dante.swiftideas.net/developer-documentation is quite thin regarding this, imo.

    #167263
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    I will forward this this to the developer for you

    – Kyle

    #167295
    MsZitac
    Member
    Post count: 6

    “Solved” it by this:
    in swift-framework\page-builder\builder\build.php, line 136 function swiftPageBuilderEditPage();

    public function swiftPageBuilderEditPage() {
    	        $pt_array = $this->swift_page_builder->getPostTypes();
    	        array_push($pt_array, 'my-secret-post-type'); //Added this line
    	        foreach ($pt_array as $pt) {
    	            add_meta_box( 'swift_page_builder', __('Swift Page Builder', "swift-framework-admin"), Array($this->swift_page_builder->getLayout(), 'output'), $pt, 'normal', 'high');
    	        }
    	    }

    Not the most beautiful way to do it. It would be nice to be able to register post types globally for this kind of functionallity.

    #167298
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi @MsZitac

    I’ve added a filter for the next update, so that you can add the post type from your child theme.

    
    $pt_arary = apply_filters('spb_post_types', $pt_array);
    

    – Ed

    #167353
    MsZitac
    Member
    Post count: 6

    That’s great @Ed.
    Otherwise there’s no other way of doing this in with the current version, but in a little prettier way besides my stuff above? That is, manipulating the post types for dante (page builder) “from outside”, in a plugin in this case?
    The thing is that my post type now also is missing the page meta box where you select “Display title” and all that. ๐Ÿ™‚ I guess these meta options will be included as well with the filtering solution in the next version?

    #167358
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi @MsZitac

    No other way of doing it in the current version.

    Unfortunately not – those meta boxes are just for the theme post types at this time. Something we may look at in the future.

    – Ed

    #181844
    floriank
    Member
    Post count: 12

    Hi @Ed,

    thanks for this! Unfortunately the typo above has made it into the code as well and the filter does not apply. Could you fix that please?

    $pt_arary = apply_filters('spb_post_types', $pt_array);

    should read

    $pt_array = apply_filters('spb_post_types', $pt_array);

    right?

    Thanks and best regards,
    Florian

    #181879
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Sorry about that, thanks for the heads up.

    – Ed

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register