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

Hiding entire part of the template based on attributes values

1612544006

Edited 1612544023
I'm quite new to roll20 system and trying to design a specific chararcter sheet Everything works perfectly until i come to my fist issue :) Basically I use the system trail of cthulhu When health_pool goes less than -6, no general competences can be used. To simulate this, i want just to hide the complete sheet that manages "general competences" I have a javascript that is launched each time health_pool is changed, because i have some computations to do, so using sheet worker that works perfectly. Now in that part of code, i was planning to just retrieve the element through the DOM and hide it, but there is no access to the DOM in character sheet. So question quite simple, how can I achieve my need with if possible not too much changing :) I know it is a beginner question and that there is probably already the answer onforum, but i have not been able tospot it
1612545337
GiGs
Pro
Sheet Author
API Scripter
If you're changing part of the sheet layout, look at  Hide Areas  on the wiki. You can link whether a section is displayed to an attribute value using CSS. In your case you probably want to create a hidden attribute and have you sheet worker set that attribute's value to 0 or 1, to make it easy to use its value in CSS.
Thanks for quick answer  I'll have a look at this section!
1612569580
Marco M.
KS Backer
Sheet Author
API Scripter
Compendium Curator
GiGs said: If you're changing part of the sheet layout, look at  Hide Areas  on the wiki. You can link whether a section is displayed to an attribute value using CSS. In your case you probably want to create a hidden attribute and have you sheet worker set that attribute's value to 0 or 1, to make it easy to use its value in CSS. Stupid question, but given that the new update is less restrictive, does it mean we can finally do this? document .getElementById( "main" ).style.visibility = "hidden" ;
1612582465
GiGs
Pro
Sheet Author
API Scripter
I very much doubt it, that's DOM manipulation which we still cant do. To be sure, you'd be better off asking that in the thread about character sheet design changes.
Sure we can't, document is unknown as object in the character sheet cutomization