Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Default Sheet Settings configuration

Hi, I have a question about the Default Sheet Settings. I have these radio buttons and div: CSS: .sheet-switch-baseModeSpellSection-show:not ( :checked )~ .sheet-switch-baseModeSpellSection  { display : none ;} .sheet-switch-fullModeSpellSection-show:not ( :checked )~ .sheet-switch-fullModeSpellSection  { display : none ;} HTML < input   type = "radio"   class = "sheet-switch-baseModeSpellSection-show sheet-switch"   title = "SpellMode"   name = "attr_SpellMode"   value = "1"   />< span   style =" text-align :  left ;"  data-i18n = "spellBaseMode"   > Base Mode </ span >       < input   type = "radio"   class = "sheet-switch-fullModeSpellSection-show sheet-switch"   title = "SpellMode"   name = "attr_SpellMode"   value = "2"   checked />< span   style =" text-align :  left ;"  data-i18n = "spellFullMode" > Full Mode </ span > < div   class = "sheet-switch-fullModeSpellSection sheet-pc-spells" > ... </ div> < div   class = "sheet-switch-baseModeSpellSection sheet-pc-spells" > ... </ div> In this way a user can hide/enable only one of these div, and he can choose the layout of this section. I have created this attribute in useroptions array: "attribute" :  "spellmode" , "displayname" :  "Spell mode? " , "type" :  "select" , "options" : [ "Base mode| " , "Full mode|checked" ] How should I set the "checked" option in the radio button? Thanks
1628535734

Edited 1628535829
Andreas J.
Forum Champion
Sheet Author
Translator
following the wiki suggestion work? <a href="https://wiki.roll20.net/Default_Sheet_Settings#Data_fields_options" rel="nofollow">https://wiki.roll20.net/Default_Sheet_Settings#Data_fields_options</a> Alternatively, set the default value of the attribute to the value on the radio button you want, it might become checked automatically that way. You can test out that sheet default settings works in the Sheet Sandbox .
I have already read this section, but it tell only how to configure the file sheet.json. But your second suggestion works fine, already tested. Thanks
1628539318

Edited 1628539357
GiGs
Pro
Sheet Author
API Scripter
For the radio button, enter a valid attribute value, which looks like it should be 1 or 2, and set a default value after the options, like so: "options" : [ "Base mode|1" , "Full mode|2" ], "default": "1" Edit: ninja'd! :)
1628540278
Andreas J.
Forum Champion
Sheet Author
Translator
Hoyer said: I have already read this section, but it tell only how to configure the file sheet.json. The Default Sheet Settings are stored in the sheet.json 's "useroptions" , so is literally what you're looking for. "type" :&nbsp; "select" , radio inputs are not "selects", so it's not surprising that might not have worked. I see that the section doesn't have clear examples of "type": "radio", so whatever worked for you could be added to the wiki for the future.
GiGs said: For the radio button, enter a valid attribute value, which looks like it should be 1 or 2, and set a default value after the options, like so: "options" : [ "Base mode|1" , "Full mode|2" ], "default": "1" Edit: ninja'd! :) It works!!
Andreas J. said: Hoyer said: I have already read this section, but it tell only how to configure the file sheet.json. The Default Sheet Settings are stored in the sheet.json 's "useroptions" , so is literally what you're looking for. "type" :&nbsp; "select" , radio inputs are not "selects", so it's not surprising that might not have worked. I see that the section doesn't have clear examples of "type": "radio", so whatever worked for you could be added to the wiki for the future. In " useroptions " i added "type": "radio" because I create a select list in the configuration page, and the wiki it's clear; the "radio" is inside the sheet.
1628541341
Andreas J.
Forum Champion
Sheet Author
Translator
Having a checked option on the sheet is likely pointless as the sheet.json's default setting overrides the html's check. &lt; input &nbsp; type = "radio" &nbsp; class = "sheet-switch-fullModeSpellSection-show sheet-switch" &nbsp; title = "SpellMode" &nbsp; name = "attr_SpellMode" &nbsp; value = "2" &nbsp; checked /&gt; So keeping or leaving "checked" here probably doesn't make a difference, bc default settings calls the shots.&nbsp;