Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Can't figure out image directory resource for themes

Calum February 9, 2021

Have read lots of articles previous answers, but can't get this to work the way it's supposed to.

I have a theme that looks likes this:

 <theme key="my-theme" name="My Theme" class="com.atlassian.confluence.themes.BasicTheme"> 
<description>My theme description</description>
<param name="includeClassicStyles" value="false"/>
<resource type="download" name="default-theme.css" location="/includes/css/default-theme.css">
<param name="source" value="webContext"/> </resource>
<resource type="download" name="css/my-theme.css" location="css/my-theme.css"/>
<space-ia value="true"/>
</theme>

So far so good, that works as expected. Now I want to add a resource for my images directory, which lives at the same level as my css directory. Everything I've read says I should then be able to reference the images as:

background-image: url(images/whatever.png)

However, I've tried including my resource between the <theme> tags:

 <resource type="download" name="images/" location="/images"/>

but that doesn't work (why not?).  Using url(images/whatever.png) just gives a 404.

If I put the resource outside the <theme> tags, at the top level of the XML file, it sort of works, in that I then have to reference the images as:

background-image: url(../images/whatever.png)

otherwise it tries to find the images in the (non-existent) images sub-directory of the css directory—why is it looking there?

Any ideas why this isn't working like everything else says it's supposed to?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events