Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Dante › Swift Page Builder for custom post type
New Landing › How can we help? › Themeforest Theme Support › Dante › Swift Page Builder for custom post type
- This topic has 11 replies, 5 voices, and was last updated 9 years by Swift Ideas – Ed.
-
Posted in: Dante
-
April 22, 2015 at 9:09 am #167166
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, ) ); }
April 22, 2015 at 9:32 am #167172Hi 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:
Thanks ๐
With Best Regards
MohammadApril 22, 2015 at 10:15 am #167213Hello 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?April 22, 2015 at 10:24 am #167219Hi,
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
MohammadApril 22, 2015 at 11:10 am #167250Ok, 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.
April 22, 2015 at 11:25 am #167263Hi
I will forward this this to the developer for you
– Kyle
April 22, 2015 at 12:22 pm #167295“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.
April 22, 2015 at 12:25 pm #167298Hi @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
April 22, 2015 at 1:51 pm #167353That’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?April 22, 2015 at 2:00 pm #167358Hi @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
June 5, 2015 at 2:53 pm #181844Hi @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,
FlorianJune 5, 2015 at 5:01 pm #181879Sorry about that, thanks for the heads up.
– Ed
-
Posted in: Dante
You must be logged in and have valid license to reply to this topic.