Streaming live at 10am (PST)

Need conditional dropdown


#1

It doesn’t appear to be possible to use the attributes of a referenced collection item in a template for conditional visibility. Is this possible?

For example, I want to hide a section based on the type of template that was selected. I have a collection “Templates” which contains sections for that template. I have another collection called “Offers” which I am setting the Template in that collection. I’d like to hide certain elements on the offers page based on the attributes in the template.

Is that possible? Or could it be added?

Thanks!
Cameron


#2

I think you can. Could you share your read-only link?


#3

You can basically hide and show anything based on an option field explicitly defined in the CMS. For instance if you have an article that has 3 sections, and you need to hide the second section, all you would need to do is add an option field in the CMS with two values, YES and NO.

Then you would call your JS/Jquery on document.ready() to remove the closest parent (section) based on the type of text in the YES/NO CMS field. Not the cleanest way of doing it but at least the resources don’t get fully loaded

Here is a fiddle;

https://jsfiddle.net/clickartke/yyok7eyq


#4

I’m not able to select the “template” data for conditional visibility. I need to hide/show certain div elements based on which template option is selected. I want to match based on a string match.

https://preview.webflow.com/preview/cameronroe?preview=046e9f3461679607a791919ecede55f6


#5

Any thoughts @vincent?


#6

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.