CMS Development

LKootz
Member

Creating an on-off toggle for modules

SOLVE

I'm attempting to create some simple template customization for my publishers (without allowing them to drag and drop)  and I'm trying to work with the boolean and/or choice field in order to make it work.

My idea is that if the module is turned on, it will display. If the publisher turns it off, the display will set to "none." Something like this below:

 

 

  #agenda
  display: {{ module.choice_field }};

 

 

As such, I created a choice with an empty value to display, and a "none" value to turn off the display and placed the widget in the CSS property.

 

It seems simple enough, but I cannot seem to get this to run properly. I'm very new to using booleans and choice fields in templates so I'm sure there's something I'm missing. Any advice would be appreciated!

0 Upvotes
1 Accepted solution
dennisedson
Solution
Community Manager
Community Manager

Creating an on-off toggle for modules

SOLVE

Hi @LKootz ,

Welcome to the Community!

the hubl is written correctly, but if that is a direct copy from the css you are using, the css itself is invalid.

You are missing the opening and ending { }.  Should look something like this

#agenda{
  display: {{ module.choice_field }};
}

loop Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.
Learn More

View solution in original post

3 Replies 3
dennisedson
Solution
Community Manager
Community Manager

Creating an on-off toggle for modules

SOLVE

Hi @LKootz ,

Welcome to the Community!

the hubl is written correctly, but if that is a direct copy from the css you are using, the css itself is invalid.

You are missing the opening and ending { }.  Should look something like this

#agenda{
  display: {{ module.choice_field }};
}

loop Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.
Learn More

LKootz
Member

Creating an on-off toggle for modules

SOLVE

Ugh, duh! Worked perfectly, thank you!

0 Upvotes
dennisedson
Community Manager
Community Manager

Creating an on-off toggle for modules

SOLVE

Trust me, I've been there 😄


loop Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.
Learn More

0 Upvotes