[Adaptable] Using checkboxes as custom profile fields

[Adaptable] Using checkboxes as custom profile fields

by Chris Dunkley -
Number of replies: 3

Hi,

I'm trying to set up Adaptable theme to use existing custom profile fields to show and hide menus. These custom fields are checkboxes that administrators can check to flag users.


In all the examples of Adaptable's custom profile field functionality a text field is used. e.g. "usertype=student"


Is it possible to use a checkbox and check whether it is checked or unchecked?


I have tried the following and not been able to get it to work:

profilefield=true

profilefield=1

profilefield=checked


Thanks in advance for your help.

Average of ratings: -
In reply to Chris Dunkley

Re: [Adaptable] Using checkboxes as custom profile fields

by Fernando Acedo -
Picture of Plugin developers Picture of Testers

This function was developed to be used with a field text only.

I never tested with other type of field but I think at least the true/false (0/1?) should works.

Did you try first using a text field?

 

 

In reply to Fernando Acedo

Re: [Adaptable] Using checkboxes as custom profile fields

by Chris Dunkley -

Hi Fernando,


Thanks for the help. I had tested using true/false and 1/0 but it turns out that was not the issue...

The issue was that I had tried to include a dash (-) in my unique identifier and when I saved the user profile field this was stripped out without my noticing. So I was looking for the equivalent of:

user-type=1

When I should have been testing for:

usertype=1


Stupid mistake but at least I got it working!


For your information in the future, I was unable to get "true/false" to work but "1/0" did work.

Thanks.

Average of ratings: Useful (1)
In reply to Chris Dunkley

Re: [Adaptable] Using checkboxes as custom profile fields

by Fernando Acedo -
Picture of Plugin developers Picture of Testers

Thanks for your testing.

True/False is used as a string and not a logical value but 1/0 should work.