How to use CPT as alternative to Taxonomy in Beaver Builder
Support › MB Relationships › How to use CPT as alternative to Taxonomy in Beaver BuilderResolved
- This topic has 3 replies, 2 voices, and was last updated 8 years ago by
Anh Tran.
-
AuthorPosts
-
November 13, 2018 at 1:16 PM #11925
tech500
ParticipantHello,
I have an urgent project to finish, and I found that Taxonomies is problematic for what I need.
The goal is very simple. I have a CPT called "solutions" and Taxonomy for it called "solutions-category".
Every solution has it's own category... but it's not possible to create in Beaver Themer an archive that shows just the categories + name + featured image.
It always shows the posts related, but not just the category. WooCommerce does that, but they used a custom code for that.
A friend told me that since Taxonomy is not an element, this can't be done in a simple way.
So I try to understand how I can use a CPT for "solutions category" instead.
CPT: Solutions
CPT: Solutions CategoryI know a relationship can solve this, but how do I do that in Meta Box is difficult to learn.
On one hand there are all the MB tools with GUI, and on the forum you always provide the code for functions.php.Can you please direct me to a tutorial about that, or tell me the steps to do this.
Thanks
DanNovember 13, 2018 at 9:57 PM #11933Anh Tran
KeymasterHi Dan,
To connect Solutions to Solutions Category, you need to install MB Relationships extension. And then follow the extension docs. Basically, all you need is the following code in
functions.php:add_action( 'mb_relationships_init', function() { MB_Relationships_API::register( array( 'id' => 'solutions_to_solution_categories', 'from' => 'solution', 'to' => 'solution_category', ) ); } );Then you can select connected solution categories when you edit a solution.
To get the connected solution categories to show on the frontend, I think it's hard to do in BB, since it doesn't support to make custom query with custom arguments yet :(. The way you query related posts is described here.
November 13, 2018 at 11:13 PM #11937tech500
ParticipantThanks Anh,
I got all the extensions installed... but I was hoping to be able to use the graphic interface and not code right now, just don't have time to learn this...
I guess most of the work with MB is done with code, and not with the plugin interface like Pods Types or ACF.
Thanks
DanNovember 14, 2018 at 3:41 PM #11948Anh Tran
KeymasterHi Dan,
For this purpose, yes, coding is required. We're updating the Builder to make it supports more features in the Meta Box and extensions. But for now, it's not there yet.
-
AuthorPosts
- You must be logged in to reply to this topic.