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

Nest a button into a roll

1745940794

Edited 1745940933
Shey L'Ours
Pro
Sheet Author
Hello there ! Well this one sounds easy, but... Well, that's what I thought too. I must have really missed something because I just can't seem to get it right... On paper, this kind of scheme is supposed to work, but in reality, nothing works. I've been looking at the problem from every angle; there must be some syntax I'm missing. I even tried replacing the button with a text input. < rolltemplate class = "sheet-rolltemplate-shey" > < div class = "sheet-extra-button" >[Show Description](~show-description)</ div > </ rolltemplate > + < button type = "roll" class = "sheet-button-description" name = "roll_ show-description " value = " &{template:shey} {{description=randomtexthere}}" ></ button > The closet I was it was with that kind of things. < rolltemplate class = "sheet-rolltemplate-shey" > < div class = "sheet-extra-button" >[Show Description](~@{Efoph Fleaug|reveal-desc})</ div > </ rolltemplate > + < input type = "text" class = "sheet-hidden" name = "attr_reveal-desc" value = "&{template:shey} {{description=randomtexthere}} " /> But even with that synthax, it display the result but also an error : No ability was found for %{@{Efoph Fleaug|reveal-desc} .
1745943302

Edited 1745943352
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
There are two ways to solve this: Pass the button as a field in the roll template , e.g. {{button=[button](~show-description)}} Pass the character name needed and then use field injection to create the button. Assuming the character name is passed in a field named character_name, option 2 looks like this in the html for the template: [Show Description](~{{character_name}}|show-deacription) Keep in mind the button that is being referred to must exist on the character sheet.
1745945442
Shey L'Ours
Pro
Sheet Author
I was pretty sure I've try that, but it seem not... it work perfectly, thanks Scott !
1745955138

Edited 1745958735
Shey L'Ours
Pro
Sheet Author
Oh dear. It work outside of repeating section, but not into it. :'( I'm really not familiar with that synthax. < fieldset class = "repeating_drive" >               < button type = "roll" class = "sheet-button-attack" name = "roll_drive" value =" &{template:shey} {{button=[Description](~show-description)}}" ></ button >               < button type = "roll" class = "sheet-hidden" name = "roll_show-description" value = "&{template: shey -description} {{description=@{drive-conditions}}}" ></ button > </ fieldset > No ability was found for %{-OOhtzi3mAvLP5cOJ04q|repeating_drive_} Oh dear. It work outside of repeating section, but not into it. :'(  Even try this, but seem disfunctional. [Description](~repeating_drive_$X_show-description) [Description](~repeating_drive_X_show-description) [Description](~repeating_drive_0_show-description) New try by manipulate the value of the button via a text/worker, neither.
1745959147
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
For repeating sections, you'll need to do some sheetworkers to get all the data in that you need (namely specifying the row id).
1745966379
Shey L'Ours
Pro
Sheet Author
Here is the correct synthax to do so. Thoses two underscore are important, only one won't work. [Description](~${id}__show-description)
1745970676
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hmm, that does not look right to me.
1746010039
Shey L'Ours
Pro
Sheet Author
Not to me neither, but thing is what it is, it work ^^'