Edit "add new listing form"
This topic contains 9 replies, has 3 voices, and was last updated by Sandro 6 years, 7 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: new listing form, snippet
-
AuthorPosts
-
April 24, 2018 at 2:29 pm #427834
Hello,
i need to know if it’s possible to hide the radio button “Set xxx as default category” on the add new listing form in the ajax Chained category display type.
Aonother question is if i can add another check button at the bottom of the add new listing form, near the accept terms and condition button ( something similar with the link at the privacy and cookies page instead of terms and condition page. We need two separate check…
We use the default “places” post.
Attached an example to explain what i mean.
Thank youSandro
April 24, 2018 at 8:42 pm #427867Hello,
GD does not include an option to add a Privacy page; instead we recommend adding a checkbox to the user profile that can be checked at resgistration with our UsersWP plugin: https://userswp.io
You can always add another custom field that is a checkbox custom field, though, but moving it down the form would not be possible without a customization.
About hiding the default category radio on the add listing page with CSS, I will flag this and see if we have a solution for you. Thanks for you patience while we look into it.
April 25, 2018 at 3:27 pm #427971Thank you Alex,
i will use the checkbox in the user profile, but i need the text of the checkbox linkable to the privacy page. Is not possible to add an html “a href” on the form label text?April 25, 2018 at 4:53 pm #427975A member asked about something similar in a previous topic, but it is not a checkbox.
https://wpgeodirectory.com/support/topic/add-custom-fields-with-link-in-add-listing/#post-363418
I will flag your question for the developers to see if they know of a solution. Thanks for your patience while they look into it.
April 26, 2018 at 4:35 am #428036Hi Sandro,
To add checkbox field similar to terms & conditions, create one custom field and make it mandatory. Then use following code snippet to add link for that field.
function _gd_custom_field_input_checkbox( $html, $cf ) { $html_var = $cf['htmlvar_name']; // CHANGE LINK HERE $link = '<a href="https://www.mysite.com/privacy" target="_blank">' . __( 'Please accept privacy conditions', 'geodirectory' ) . '</a>'; $value = geodir_get_cf_value( $cf ); if ( $value == '' && $cf['default'] ) { $value = '1'; } if ( $value != '1' ) { $value = '0'; } ob_start(); ?> <div id="<?php echo $cf['name'];?>_row" class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details"> <label> <?php $site_title = __($cf['site_title'], 'geodirectory'); echo (trim($site_title)) ? $site_title : ' '; ?> <?php if ($cf['is_required']) echo '<span>*</span>';?></label> <input type="hidden" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" value="<?php echo esc_attr($value);?>"/> <input <?php if ($value == '1') { echo 'checked="checked"'; }?> value="1" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="checkbox" onchange="if(this.checked){jQuery('#<?php echo $cf['name'];?>').val('1');} else{ jQuery('#<?php echo $cf['name'];?>').val('0');}"/> <span class="geodir_message_privacy"><?php echo $link; ?></span> <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span> <?php if ($cf['is_required']) { ?> <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span> <?php } ?> </div> <?php $html = ob_get_clean(); return $html; } add_filter( 'geodir_custom_field_input_checkbox_geodir_Privacy', '_gd_custom_field_input_checkbox', 10, 2 );
In “geodir_custom_field_input_checkbox_geodir_Privacy” replace “geodir_Privacy” with your field name.
Change the link to your desired one that you want.===
To hide “Set xxx as default category” use following css snippet..post_catlist_item .post_default_category { display: none }
Kiran
April 26, 2018 at 8:52 am #428065Excuse me Kiran, be patient …
As suggested by Alex I entered the privacy flag in the registration form of userswp.
Is this snippet okay anyway or does it need a different one?April 26, 2018 at 10:56 am #428085Hello Sandro,
If you are happy with the UsersWP functionality, then the first PHP snippet may not be needed.
If I misunderstood your question, please write back and let us know more so we can help.
Thanks
April 26, 2018 at 3:15 pm #428132Hello Alex,
i resolved using the po translate file of userswp, changing the “accept terms and conditions” phrase to “I agree to the treatment of my personal information” with the link to the privacy page (that is different from terms and conditions page of listings) in the registration form. Not sure if it’s the right method…April 26, 2018 at 3:48 pm #428136Sounds good! There are many possibilities for tuning with the language files.
Good fix!
May 3, 2018 at 1:03 pm #428926Perfect Alex, thank you again.
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket