Hunter Lyons Posted August 3, 2019 Posted August 3, 2019 I have a custom field called information box. If you turn it on, in my Pages Database, a wiki-style info box appears. There are a few other custom fields -- topic spaces, quote content, quote author, etc. Ultimately, it makes this appear, floating to the right of the content area: However, all of those other fields are useless if the person disables the information box. With the box disabled, they do nothing. Because of this, I'm wondering -- is there any way I can make those custom fields disappear when someone disables the info box?
opentype Posted August 3, 2019 Posted August 3, 2019 So how is the output created in the first place? Is it a custom template where you access those fields individually? If so, you would just wrap that entire section with an IF query, so it would only show if the information box checkbox value is set. {{if $yourfield}} //Information box output {{endif}}
Hunter Lyons Posted August 3, 2019 Author Posted August 3, 2019 In the Template, I have that setup -- if someone turns it on, it shows the info box. That part works. But I mean on the Edit page. Am I able to somehow select the relevant fields and blanket them in an if statement? Do you see what I mean? I want to set it up so that when info box is disabled, the fields below it disappear or collapse somehow, since they are not needed in that case. It's an odd request, but I will likely have laymen editing articles on the wiki, so I want to make sure they're not confused by 10 fields they don't need when the info box is off.
opentype Posted August 3, 2019 Posted August 3, 2019 That’s not so easy. While the IPS framework does support such toggles, they aren’t directly available in the database form. You would have to hard-code that into the Pages form template. Or just don’t have that toggle to begin with. You could just as well dynamically show the box just depending on the user input, not a specific setting.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.