Skip Navigation

[Resolved] category css problem

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 6 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Ian Nask 6 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#526129

Hi, I had a proble before with categorys style, here is ticket: https://toolset.com/forums/topic/taxonomies-style/

Now i got more info from my theme support and got to know this form is showing the select fields and the select2 script is added in it, that's why its showing this way (The scripts and styles for select2 is unique and is included in the theme. If any element which uses the select2 this styling will be added in it automatically).

A select2 script is shown this way only and its designed cannot be changed.

I was thinking, is it possible to rename this select field in plugin code somehow or it is defined by html?

#526185

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Ian

CRED doesn't add the placeholder attribute to multiple select fields (because the default browser display of such a field doesn't provide for displaying placeholder text).

In your case where you theme is converting the select box to use the select2 library, placeholder text can be added, but as it is your theme initiating the select2 code you don't have an opportunity to add it at the time.

I think your only option in this case it to assign the placeholder attribute yourself using Javascript.

This should work for that particular select dropdown on that page:

( function( $ ) {
	$( window ).load( function(){

		$('.cred-taxonomy-team_department input.select2-search__field').attr({
			'placeholder':'choose something',
			'style':'' 
		});
	});
})( jQuery );

You will need to edit the placeholder text. For some reason there is an inline width style added which prevents the placeholder text being visible which this also removes. And note that I have used the window load event to trigger this code, by when, hopefully, your theme will have replaced the CRED multiselect with the select2 instance.

#526197

Hi,

Thanks for your kind help. I have silly question: Do I need to insert this code in my theme functions.php or somewhere else?

#526202

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

On your CRED form in the Content Editor there are panels for custom CSS and JS.

You should be able to just copy and paste that code into the custom JS panel.

Let me know how you get on.

#526208

ohh, cool, it's working! Many thanks for your help!

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.