Profile pages using MB User Profile and MB Beaver Builder Integration
Support › MB User Profile › Profile pages using MB User Profile and MB Beaver Builder Integration
- This topic has 25 replies, 2 voices, and was last updated 2 years, 5 months ago by
Peter.
-
AuthorPosts
-
November 30, 2022 at 8:03 AM #39408
Peter
ModeratorHello Jan,
Here is my screen record so that you can understand how the conditional logic works with other elements on the same page https://drive.google.com/file/d/1-jelzCptVwMPl_8p186pni4d9P4lTjUl/view?usp=sharing
You can wrap the
quform
shortcode in a div with a specific ID and use the ID in the conditional logic code.add_filter( 'rwmb_outside_conditions', function( $conditions ) { $conditions['#quform-1'] = array( 'visible' => ['#select_operations', 'drc_other'], ); $conditions['#quform-14'] = array( 'visible' => ['#select_operations', 'zimbabwe_other'], ); $conditions['#quform-13'] = array( 'visible' => ['#select_operations', 'zimbabwe_todal'], ); $conditions['#quform-12'] = array( 'visible' => ['#select_operations', 'zimbabwe_ccih_sabot'], ); return $conditions; } );
You can change
form 1
form 14
with the shortcode on your site and put the code anywhere on the same page.<div id="quform-1">form 1</div> <div id="quform-14">form 14</div> <div id="quform-13">form 13</div> <div id="quform-12">form 12</div>
Note: the select option value should be in lowercase, no space, like this
drc_metalkol: Drc - Metalkol drc_other: Drc - Other mali_all: Mali - All mauritius_all: Mauritius - All mozambique_all: Mozambique - All south_africa_emsa: South Africa - Emsa south_africa_sabot: South Africa - Sabot south_africa_other: South Africa - Other zambia_chambishi: Zambia - Chambishi zambia_sabot: Zambia - Sabot zambia_other: Zambia - Other zimbabwe_ccih_sabot: Zimbabwe – Ccih (Sabot) zimbabwe_todal: Zimbabwe – Todal zimbabwe_other: Zimbabwe – Other
November 30, 2022 at 12:50 PM #39411Jan van Niekerk
ParticipantHi Peter
Thank you so much for your help. I applied your code see below to profile page and theme functions page. The problem is all the form are appearing not just the ones I have selected :
So for example on the profile demo page, under selected operations, there is “ Drc – Other, Zimbabwe – Ccih (Sabot), Zambia – Sabot, Drc - Metalkol” only those need to show up as only they were selected in the registration form when signing up, not all the forms.
Profile page
<div id="quform-1">[quform id="1" name="DRC Other"]</div> <div id="quform-2">[quform id="2" name="DRC Metalkol"]</div> <div id="quform-3">[quform id="3" name="Mali"]</div> <div id="quform-4">[quform id="4" name="Mauritius"]</div> <div id="quform-5">[quform id="5" name="Mozambique"]</div> <div id="quform-6">[quform id="6" name="South Africa EMSA"]</div> <div id="quform-7">[quform id="7" name="South Africa Sabot"]</div> <div id="quform-8">[quform id="8" name="South Africa Other"]</div> <div id="quform-9">[quform id="9" name="Zambia Chambishi"]</div> <div id="quform-10">[quform id="10" name="Zambia Sabot"]</div> <div id="quform-11">[quform id="11" name="Zambia Other"]</div> <div id="quform-12">[quform id="12" name="Zimbabwe CCIH"]</div> <div id="quform-13">[quform id="13" name="Zimbabwe Todal"]</div> <div id="quform-14">[quform id="14" name="Zimbabwe Other"]</div>
I added the following code to my theme functions file :
add_filter( 'rwmb_outside_conditions', function( $conditions ) { $conditions['#quform-1'] = array( 'visible' => ['#select_operations', 'drc_other'], ); $conditions['#quform-2'] = array( 'visible' => ['#select_operations', 'drc_metalkol'], ); $conditions['#quform-3'] = array( 'visible' => ['#select_operations', 'mali_all'], ); $conditions['#quform-4'] = array( 'visible' => ['#select_operations', 'mauritius_all'], ); $conditions['#quform-5'] = array( 'visible' => ['#select_operations', 'mozambique_all'], ); $conditions['#quform-6'] = array( 'visible' => ['#select_operations', 'south africa_emsa'], ); $conditions['#quform-7'] = array( 'visible' => ['#select_operations', 'south africa_sabot'], ); $conditions['#quform-8'] = array( 'visible' => ['#select_operations', 'south africa_other'], ); $conditions['#quform-9'] = array( 'visible' => ['#select_operations', 'zambia_chambishi'], ); $conditions['#quform-10'] = array( 'visible' => ['#select_operations', 'zambia_sabot'], ); $conditions['#quform-11'] = array( 'visible' => ['#select_operations', 'zambia_other'], ); $conditions['#quform-12'] = array( 'visible' => ['#select_operations', 'zimbabwe _ccih_sabot'], ); $conditions['#quform-13'] = array( 'visible' => ['#select_operations', 'zimbabwe_todal'], ); $conditions['#quform-14'] = array( 'visible' => ['#select_operations', 'zimbabwe _other'], ); return $conditions; } );
November 30, 2022 at 3:05 PM #39412Jan van Niekerk
ParticipantHi Peter
I also just wanted to add these select are from the multiselect fields ( advanced select) not a dropdown as show in your screen cast example.
December 2, 2022 at 8:05 PM #39456Jan van Niekerk
ParticipantOK I seem to have found a work around, but now I am battle with one last issue, when a registration form is filled in on the front end none of the fields are pulling through and saving on the back end. Not the standard user fields or the custom fields added. only the username and password is saved.
Maybe it s because I have created a custom user type " vendor". But i have check that is the default registration type and i created the role using a plugin "user role editor"
PLEASE HELP
December 2, 2022 at 9:41 PM #39457Peter
ModeratorHello Jan,
Let me check that issue on your site.
December 2, 2022 at 11:14 PM #39462Peter
ModeratorI've removed the condition in "Advanced location rules" (MB Include Exclude) to fix this issue. Screenshot https://monosnap.com/file/ZcVNJfH7e3zBrhHzZuGScV4U01G8GW
December 3, 2022 at 12:55 AM #39464Jan van Niekerk
ParticipantHi Peter
Thank you so much it finally works, just 2 more little favour please.
1) styling the registration form, how do I make the fields side by side and also the check boxes.
2) Then with the checkboxes is it possible for the check to appear inline before the textDecember 4, 2022 at 10:36 PM #39485Peter
ModeratorHello Jan,
1. To display fields side by side, you can use the extension MB Columns, please read more on the documentation https://docs.metabox.io/extensions/meta-box-columns/
2. I think it is not difficult with some CSS code, you can contact your developer to ask for help with this issue.December 5, 2022 at 12:55 PM #39499Jan van Niekerk
ParticipantHi Peter
I used MB Columns for the middle part of the form. The beginning is generated by WordPress. The end part with the check boxes can be put into groups and it looks fin on the form part, but then the information does not pull through onto the profile page.
I must also express my disappointment, I have asked multiple times for a small live session to explain things and speeds the project up and you agreed but have never shown up 🙁
December 5, 2022 at 11:12 PM #39515Peter
ModeratorHello Jan,
Sorry about the live session, it is also beyond our scope of support. I recommend contacting our Key Master Anh Tran if he allows providing this kind of support. Thanks for your understanding and patience.
Regarding the issue "then the information does not pull through onto the profile page", I see you've confirmed it works above. Does it not work for now? -
AuthorPosts
- You must be logged in to reply to this topic.