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

Adding an image to the Title of the default roll template

January 11 (1 year ago)

I saw a post about this a while back and am trying to replicate it.

Apparently you could upload an image and tell the macro to use that image.  I cannot get it to work and was wondering if someone would be willing to write out the step by step process?

January 11 (1 year ago)

Addition: This was the code I saw: &{template:default}{{name=[x](YOUR_IMAGE_URL#.png)}}{{test=foo}} but I don’t know where to save my png file so it can see it

January 11 (1 year ago)

Edited January 11 (1 year ago)

If you upload a picture to Roll20, then use that image somewhere (handout, token default image, etc.) you can right click on the image and get the location where Roll20 has stored the image and use that. You won’t be able to use the token when it’s on the VTT though, as right-clicking will bring up the Roll20 context menu (changing token settings, changing layers, etc.) and you won’t see the computer context menu that will let you save-as or find the image location. 

January 12 (1 year ago)
The Aaron
Roll20 Production Team
API Scripter

selecting a token and hitting Z is the easiest way to get an image you can right click to copy the URL.

January 12 (1 year ago)

Ok, that was helpful.  However, the code does not seem to resolve.  Is there some sort of syntax I need to add or omit?


Resolves to this:


January 12 (1 year ago)


January 12 (1 year ago)

Pretty sure the [x](#.png) is needed with the URL. so in your example

{{name=[x](https://files.d20.io/images/374971798/mleNAfFktGOvtZmbOwqPFA/original.png?17050081885#.png)}}
January 12 (1 year ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

In the case of a Roll20 image (they are all converted to pngs upon upload), it should suffice just to use:

{{name=[x](https://files.d20.io/images/374971798/mleNAfFktGOvtZmbOwqPFA/original.png)}}

I don't think the cache buster numbers at the end perform a useful function here. But test it. I could be wrong.


If you don't want to mess with lengthy URLs, and don't want to take up your quota, you can use an  image service like imgur.com to host the graphics.

January 12 (1 year ago)

&{template:default} {{name=[x](https://files.d20.io/images/374971798/mIeNAfFktGOvtZmbOwqPFA/original.png?17050081885)}}

This is what I ended up having to do for it to recognize it and resolve.  However, I am not actually getting the picture.

I appreciate all the help so far.  It feels like we are so close! ha ha.

Still no picture:


January 12 (1 year ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Get rid of the cache buster numbers (including question mark) and use this:

&{template:default} {{name=[x](https://files.d20.io/images/374971798/mIeNAfFktGOvtZmbOwqPFA/original.png)}}



January 12 (1 year ago)

You guys are awesome.  Thanks so much for the help!  It works!

January 12 (1 year ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

BTW, unless you are planning on adding more to this, none of that code is necessary. If all you want to do is display the graphic in chat, then you can just enter the raw URL, with or without extra numbers:

https://files.d20.io/images/374971798/mIeNAfFktGOvtZmbOwqPFA/original.png?17050081885