Forum Replies Created
-
AuthorPosts
-
Tan Nguyen
ParticipantHi Sinusite,
Thanks for purchasing Conditional Logic and reporting documentation missing, you rock man ๐
For postexcerpt or taxonomy_div, you can add filter to rwmb_outside_conditions like so:
add_filter( 'rwmb_outside_conditions', function( $conditions ) { $conditions['postexcerpt'] = array( 'hidden' => array( 'relation' => 'and', 'when' => array( array('post_format', '=', 'aside') ) ) ); return $conditions; } );P/S: The conditional logic array should be simplified like example below but it's a bug on our extension and you'll get the update on the next 24 hour:
$conditions['postexcerpt'] = array( 'hidden' => array('post_format', 'aside' ) );Thanks and Best regards
Tan Nguyen
Tan Nguyen
ParticipantHi man,
Thanks again for sharing your idea.
Basically, Conditional Logic is the extension to show or hide meta box fields or whole meta box. Each field or meta box id is unique, so we cannot registered two fields or meta boxes at a same time.
That feature which you've requested is to change the field options (or values) when the conditional is meet, currently, we don't support it but as a great idea, we'll try to implement this feature on the next major update, about late August.
Best regards
Tan Nguyen
July 30, 2015 at 4:48 AM in reply to: Metaboxes started to disappear in admin UI - Only 10 show up #1139Tan Nguyen
ParticipantHi ccatalina,
Please update to the latest version, it has some improvements and fixed that bug.
Best regards
Tan Nguyen
Tan Nguyen
ParticipantHi alsk
Sorry for late reply, I've double check our plugin and it's supports page template. Can you please check your theme if template exists?
Best Regards
Tan Nguyen
Tan Nguyen
ParticipantHi alsk,
Thanks for using MB Builder, I'm adding this feature and you'll get update within next 24 hours.
Best Regards
Tan Nguyen
Tan Nguyen
ParticipantHi catarinacarraro,
Thanks for your question, unfortunately, we're currently not support that feature yet. We'll mention it to think a way to improve our Conditional Logic.
Thanks and Best Regards.
Tan Nguyen
Tan Nguyen
ParticipantCan you please send me your meta box code? So I can fix it for you.
Tan Nguyen
ParticipantHi catarinaarraro,
As your logic, this is my snippet, you can edit to fit to your project:
add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) { $meta_boxes[] = array( 'id' => 'brand_product', 'title' => 'Brands and Products', 'post_types' => array( 'post', 'page' ), 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'id' => 'fone_id', 'name' => 'Brand', 'desc' => 'Pick Your Favourite Brand', 'type' => 'select', 'options' => array( 'apple' => 'Apple', 'android' => 'Android', 'windowsphone' => 'WindowsPhone' ) ), array( 'id' => 'apple_products', 'name' => 'Select your apple product?', 'type' => 'checkbox_list', 'options' => array('iPhone', 'iPad', 'iPod'), 'visible' => array( 'fone_id', '=', 'apple' ) ), array( 'id' => 'android_products', 'name' => 'Select your android product?', 'type' => 'checkbox_list', 'options' => array('Galaxy', 'ZenPhone', 'Tablet'), 'visible' => array( 'fone_id', '=', 'android' ) ), array( 'id' => 'windowsphone_products', 'name' => 'Select your apple product?', 'type' => 'checkbox_list', 'options' => array( 'Nokia', 'Galaxy' ), 'visible' => array( 'fone_id', '=', 'windowsphone' ) ) ) ); return $meta_boxes; } );Best regards
Tan Nguyen
Tan Nguyen
ParticipantHi catarinacarraro,
Thanks for purchasing and using MB Conditional Logic.
Sorry, this problem because Conditional Logic isn't compatibility with your PHP version, this is our bug and we'll have an update on the next day and you'll get the update shortly.
To fix it now, you can simply replace
['and', 'or']with
array('and', 'or')Then that line with become:
$relation = ( isset( $condition['relation'] ) && in_array( $condition['relation'], array('and', 'or') ) ) ? $condition['relation'] : 'and';Thank you and best regards.
Tan Nguyen
Tan Nguyen
ParticipantHi Alona,
Thanks for using our plugins.
We wouldn't recommend you include plugin in theme, the reason is same as Include Meta Box Plugin In Themes/Plugins, you can use TGM Activation Class to tell users that your theme is required that plugin.
But incase you really need to include plugin into your theme, here is the solution. Looks like you've already purchased MB Conditional Logic, so I'll use this plugin and twentyfifteen theme for example:
1. Copy whole plugin directory to your theme, for example twentyfiteen/inc
2. Open your functions.php, add this snippet to the last:if ( is_admin() ) { define( 'MBC_URL', get_template_directory_uri() . '/inc/meta-box-conditional-logic/' ); define( 'MBC_DIR', get_template_directory() . '/inc/meta-box-conditional-logic/' ); require MBC_DIR . '/meta-box-conditional-logic.php'; }Or you can change
incdirectory to whatever you want.Best regards
Tan Nguyen.
Tan Nguyen
ParticipantYou're welcome, and please don't hesitate to tell us if you have problem.
Tan Nguyen
ParticipantHi umtang41,
Just want to notify you. Did you used Conditional Logic? Does it solved your problem? And please don't hesitate to tell us if you have problem or confusing when using it ๐
Regards
Tan Nguyen.
Tan Nguyen
ParticipantHi Cristian,
Thanks for using MB Conditional Logic.
Conditional Logic can works with any DOM element, so you can set the visibility for meta box if page is child or parent. This is some usage example:
Visible when the page is parent (root)
'visible' => array('parent_id', '')Visible when the page is child
'visible' => array('parent_id', '!=', '')Visible when the page's parent ID is 99
'visible' => array('parent_id', 99)Visible in certain page (ID > 101 for example):
'visible' => array('post_ID', '>', 101)These examples above uses visible action, you can use hidden action in case you want to hide it.
Regards.
Tan Nguyen
ParticipantHi Maxell,
That fatal error happened when you assign a value to function. You cannot do that.
For this problem, we'll need to change the logic before
$smof_datahas overridden byrwmb_meta. After that, we have no chance to do it. For example, we'll assign each $smof_data index with rwmb_meta key only if current page is not search page. You can post some lines on that file and I'll have a look at with you.Regards.
Tan Nguyen
ParticipantHi Maxell,
Can you show me where did you put
rwmb_metafunction? If you wanna show meta box value on singular pages, like Post or Page, you can put rwmb_meta to single.php, page.php or singular.php (depend on your template hierarchy).In case both singular pages and archive pages in your theme are included same file. You can exclude rmmb_meta on search page like so:
// Only execute rwmb_meta function when current page is not search page if ( ! is_search() ) rwmb_meta('your_value');Regards
Tan Nguyen
-
AuthorPosts