Badge

This topic contains 15 replies, has 3 voices, and was last updated by  virginie 4 years, 3 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #528910

    virginie
    Buyer
    Post count: 115

    Hi,

    I use the badge function for checkbox fields and it works very well, how can I use it for multiselect fields?

    Thanks

    #528921

    Kor
    Moderator
    Post count: 16516

    Hi virginie,

    Thanks for your post. Sorry, I’m not getting this. Which “badge function for multiselect fields” are you referring to?

    #528926

    virginie
    Buyer
    Post count: 115

    Hi kor,

    For example, in custom fields, for a mutiselect field, how can I make the selected answer appear in a badge?

    Am I clear?

    Thanks

    #528937

    virginie
    Buyer
    Post count: 115

    For example, I would like to display the types of payment on the ads (see captures).
    how to configure gd_post_badge for multiselect fields?

    #529155

    Alex Rollin
    Moderator
    Post count: 27815

    You can use is_contains

    
    
    
    [gd_post_badge key="payment_methods" condition="is_contains" search="Visa" badge="Visa" bg_color="#0073aa" txt_color="#ffffff"]
    
    #529297

    virginie
    Buyer
    Post count: 115

    Thanks alex
    It’s not working.

    Actually, I’d like to know if it’s possible that a badge could be displayed for each choice.

    for example if the user checks credit cards + cash + bank tranfer, a badge for each option checked is displayed.

    is it possible?

    Thanks

    #529317

    Alex Rollin
    Moderator
    Post count: 27815

    Try using the shortcode builder. To use the code I shared you will need to update the key and search value.

    #529321

    virginie
    Buyer
    Post count: 115

    yes I tried that with the generator and the good key etc

    Is there anything else to set up?

    Thanks

    #529414

    Alex Rollin
    Moderator
    Post count: 27815

    Nope, I just tried it again with a widget and it works as expected.
    Try a widget?

    If that doesn’t work please share WP Admin credentials so we can check the settings.

    #529446

    virginie
    Buyer
    Post count: 115

    yes thank you alex, in what you propose you have to create a badge model for each available option.

    In fact, I thought there might be a solution to create an empty badge where all the selected answers are displayed.

    That’s why I thought it didn’t work, but assigning a badge per answer works very well, it’s just a bit long because I have a lot of options.

    is there a place where I can find explanations on the different configurations ( empty , no empty etc…)

    A big thank you, alex, for your help.

    #529557

    Alex Rollin
    Moderator
    Post count: 27815

    Yes, badges for each.

    empty means the field has 0 or no value
    not empty means it has some value

    #529821

    virginie
    Buyer
    Post count: 115

    Hi,

    ok
    and is it possible to create a badge for a text field?
    thank you

    #529874

    Alex Rollin
    Moderator
    Post count: 27815

    Yes, you could use the ‘is not empty’ setting, then for the badge use %%input%% to show the value entered into the field.

    #529950

    virginie
    Buyer
    Post count: 115

    Hi,

    I tested and I must make a mistake because it’s %%input%% that shows up on the badge.

    Here is what I configured, could you tell me how to fix it, please?

    [gd_post_badge key=”situation” condition=”is_not_empty” badge=”%% input %%” bg_color=”#408080″ txt_color=”#ffffff” size=”medium”]

    Thank you in advance

    #530027

    Alex Rollin
    Moderator
    Post count: 27815

    This works for me:

    
    
    
    [gd_post_badge key="some_text" condition="is_not_empty" badge="%%input%%" bg_color="#0073aa" txt_color="#ffffff" size="extra-large"]
    

    Looks like you have some extra spaces in the badge=

    %%input%%
    %% input %%
Viewing 15 posts - 1 through 15 (of 16 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket