[SOLVED] Create Terms and Conditions in Community Builder

11 years 5 months ago #214245 by walkyrie
great for you... which one?!!

Please Log in to join the conversation.

11 years 5 months ago #215952 by aussiemike
Would you please share your solution. I would also like to see a popup or modal window for terms and conditions. Opening another window or tab just seems a little 'unprofessional' these days.

Any solutions appreciated.

Mike

Please Log in to join the conversation.

11 years 5 months ago #215989 by krileon
You can use CB Auto Actions with a Code action on the before registration form display to add jQuery to the header that causes a jQuery ui model display (load ui-all jQuery plugin) on click. Below should work.

Type: Code
Triggers: onBeforeRegisterFormDisplay
Access: Everybody
Method: jQuery
Code:
$( 'body' ).append( '<div id="cbfv_termsc_dialog" style="padding: 0; margin: 0; overflow: hidden;"><iframe src="' + $( '#cbfv_termsc a' ).attr( 'href' ) + '" width="100%" height="100%"></iframe></div>' );
$( '#cbfv_termsc_dialog' ).dialog({
	title: $( '#cbfv_termsc a' ).html(),
	resizable: false,
	draggable: false,
	modal: true,
	autoOpen: false,
	width: ( $( window ).width() * 0.9 ),
	height: ( $( window ).height() * 0.9 )
});
$( window ).resize( function() {
	$( '#cbfv_termsc_dialog' ).dialog( 'option', 'width', ( $( window ).width() * 0.9 ) );
	$( '#cbfv_termsc_dialog' ).dialog( 'option', 'height', ( $( window ).height() * 0.9 ) );
});
$( window ).scroll( function() {
	$( '#cbfv_termsc_dialog' ).dialog( 'option', 'position', 'center' );
});
$( '.cbRegistration' ).delegate( '#cbfv_termsc a', 'click', function() {
	$( '#cbfv_termsc_dialog' ).dialog( "open" );
	return false;
});
Plugins: ui-all

The above is thoroughly tested as working. It'll turn the terms and conditions URL into a hidden iframe then on click will open it in a browser window sized jQuery dialog (it'll resize with the browser and always scroll into view) of the iframe. You'll need to edit your terms and conditions url and append &tmpl=component so it only shows the article though.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: aussiemike, cesarmtz

Please Log in to join the conversation.

11 years 5 months ago #216028 by aussiemike
Thank you. I am new to the auto actions plugin so this has been a good starting point.

I was almost going to say it didn't work but then realised that I had not published the plugin.

I do have a question though. I am using a mobile responsive template. Is there an edit to the code that would make the popup responsive to the browser size? I did a bit of playing around with it but only managed to resize the window.

Thanks Kyle, I'm sure I will have a few more questions about the auto actions. Is there any documentation besides the examples given on the information page?

Regards
Mike

Please Log in to join the conversation.

11 years 5 months ago #216125 by krileon

I do have a question though. I am using a mobile responsive template. Is there an edit to the code that would make the popup responsive to the browser size? I did a bit of playing around with it but only managed to resize the window.

Leave the code as is as it already adjusts based off browser size. It'll also resize as the browser is resized.

Is there any documentation besides the examples given on the information page?

Nope, they're just automations of various actions. Many of them are self explanatory as they walk you through each parameter and have descriptions of what each parameter does. The Code action requires coding knowledge as it just executes the various methods at the trigger selected.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: aussiemike

Please Log in to join the conversation.

11 years 3 months ago #219818 by cesarmtz
It worked for me but know I would like to add an OK button at the bottom of the window. I tried but it did not work out. Could you help me please?

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.285 seconds

Facebook Twitter LinkedIn