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 .
×
May your rolls be merry + bright! 🎄
Create a free account

Roll Template Question: IS there a way to change the icon from this roll template I made, without having to just have a bunch of separate templates.

1693000137

Edited 1693003067
So I want to swap out the images, I have icons for each dice. Would I have to to just make a new nearly identical template for each? OR is there way I can include it in the roll-button? I have the same thing for skills, with icons for each so if possible it'd be nice rather than have just a tons of roll templates. Here what it looks like currently: and here is my code: &lt;rolltemplate class="sheet-rolltemplate-roswell_dice"&gt; &lt;!--Spacer BOX--&gt;&lt;div style="height:15px;"&gt;&lt;/div&gt; &lt;div class="sheet-container"&gt; &lt;div class="sheet-header"&gt; {{#title}}&lt;div class="sheet-title"&gt;{{title}}{{/title}}&lt;img class="sheet-roll_icon" src=" <a href="https://i.imgur.com/miOqXB4.png" rel="nofollow">https://i.imgur.com/miOqXB4.png</a> " alt="D2"&gt;&lt;/div&gt; {{#subtitle}}&lt;div class="sheet-subtitle"&gt;{{subtitle}}&lt;/div&gt;{{/subtitle}} &lt;/div&gt; &lt;div class="sheet-content"&gt; &lt;div&gt; {{#result}}&lt;div class="sheet-result"&gt;{{result}}&lt;/div&gt;{{/result}} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/rolltemplate&gt;
1693001518

Edited 1693001620
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You can use fields in the class property of elements, so then you'd just use CSS to display the appropriate image.&nbsp; HTML &lt;rolltemplate class="sheet-rolltemplate-roswell_dice"&gt; &lt;!--Spacer BOX--&gt;&lt;div style="height:15px;"&gt;&lt;/div&gt; &lt;div class="sheet-container"&gt; &lt;div class="sheet-header"&gt; {{#title}}&lt;div class="sheet-title {{die}}"&gt;{{title}}{{/title}}&lt;/div&gt; {{#subtitle}}&lt;div class="sheet-subtitle"&gt;{{subtitle}}&lt;/div&gt;{{/subtitle}} &lt;/div&gt; &lt;div class="sheet-content"&gt; &lt;div&gt; {{#result}}&lt;div class="sheet-result"&gt;{{result}}&lt;/div&gt;{{/result}} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/rolltemplate&gt; CSS .sheet-d2:after{ &nbsp;&nbsp;&nbsp;&nbsp; content:''; &nbsp;&nbsp;&nbsp;&nbsp;width: 20px; &nbsp;&nbsp;&nbsp;&nbsp;height: 20px; &nbsp;&nbsp;&nbsp;&nbsp;background-image: <a href="https://i.imgur.com/miOqXB4.png" rel="nofollow">https://i.imgur.com/miOqXB4.png</a>; &nbsp;&nbsp;&nbsp;&nbsp;background-repeat: no-repeat; &nbsp;&nbsp;&nbsp;&nbsp;background-size:contain; } EDIT: Also, I'd suggest not using a spacer box. There's CSS like padding and margin for that purpose.