Skip Navigation

[Resolved] Problem with input label for child categories

This support ticket is created 4 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by brandonJ 4 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#1485215

I am trying to:

Figure out what is generating the hyphen at the beginning of child category labels

Link to a page where the issue can be seen:

hidden link

I expected to see:

Instead, I got:

This page displays a parametric search of parent categories and child categories. At the front of each child category term is a hyphen or dash. I understand that it is there to show that category is a child of the parent above, but I would like to remove it. Do you have any idea how to do that, or what generates it?

#1486031

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

To remove those dash (hyphen), we need to add the custom JS code.

If you can share admin access detail - I can add it and share with you.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1488365

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - Thank you for sharing the access details.

To remove the dash, I've added the following JS code to your view's "Search and Pagination" sections JS editor:

jQuery(document).ready(function($){
  
$("div.radio label:contains('-')").each(function(){
   
    var text = $(this).html();
   
    text = text.replace("  -", "");
    $(this).html(text);                   
});

});

 jQuery( document ).on( 'js_event_wpv_parametric_search_form_updated', function( event, data ) {
	/**
	* data.view_unique_id (string) The View unique ID hash
	* data.view_changed_form (object) The jQuery object for the View form after being updated
	* data.view_changed_form_additional_forms_only (object) The jQuery object containing additional forms from other instances of the same View inserted using the [wpv-form-view] shortcode
	* data.view_changed_form_additional_forms_full (object) The jQuery object containing additional forms from other instances of the same View inserted using the [wpv-view] shortcode
	*/
   jQuery("div.radio label:contains('-')").each(function(){
   
    var text = jQuery(this).html();
   
    text = text.replace("  -", "");
    jQuery(this).html(text);                   
});
	
});

Can you please confirm - it works at your end.

#1488665

Hi Minesh. Thank you so much for doing that, I appreciate your help. It works great. Cheers, Brandon