# Image not loading when in admin pages

**URL:** <https://community.developer.atlassian.com/t/image-not-loading-when-in-admin-pages/17386>\
**Category:** Jira Server\
**Tags:** webresource, context\
**Created:** [April 14, 2018, 9:25pm UTC](https://community.developer.atlassian.com/t/image-not-loading-when-in-admin-pages/17386 "2018-04-14T21:25:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathieu.yargeau](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@mathieu.yargeau](https://community.developer.atlassian.com/u/mathieu.yargeau)\
**Post date:** [April 14, 2018, 9:25pm UTC](https://community.developer.atlassian.com/t/image-not-loading-when-in-admin-pages/17386/1 "2018-04-14T21:25:14Z")

</div>

I have a web-item in the top navigation bar which in an icon. It displays fine, except when I am in an administration page. What am I doing wrong?

Atlassian-plugin.xml

> ```
> <web-item key="my_item" section="system.top.navigation.bar" weight="99999">
> <link linkId="my_item_link">/secure/Something!WebWork.jspa</link>
> <styleClass>aui-button aui-button-primary</styleClass>
> <label></label>
> <tooltip key="item.tooltip"></tooltip>
> <dependency>${project.groupId}.${project.artifactId}:my-item-resources</dependency>
> </web-item>
> 
> <web-resource key="my-item-resources" name="my-item-resources">
> <dependency>${atlassian.plugin.key}:common-resources</dependency>
>   
> <transformation extension="js">
> <transformer key="jsI18n"/>
> </transformation>
>     
> <resource type="download" name="my-item.js" location="/js/my-item.js" />
>   
> <context>my-item</context>
> </web-resource>
> 
> <web-resource key="common-resources" name="Common Web Resources">
> <dependency>com.atlassian.auiplugin:aui</dependency>
> <dependency>com.atlassian.auiplugin:aui-experimental</dependency>
> <dependency>com.atlassian.auiplugin:aui-table-sortable</dependency>
> 
> <transformation extension="js">
> <transformer key="jsI18n"/>
> </transformation>
> 
> <resource type="download" name="images/" location="/images" />
>   
> <resource type="download" name="my-item.css" location="/css/my-item.css"/>
>   
> <resource type="download" name="my-item.png" location="/images/my-item.png">
> <param name="content-type" value="image/png"/>
> </resource>
>   
> <context>atl.general</context>
> <context>atl.admin</context>
> <context>common</context>
> <context>my-item<context>
> </web-resource>
> 
> ```

my-item.css

> #my\_item\_link {  
> background-image: url(“my-item.png”);  
> background-repeat: no-repeat;  
> background-size: 16px 16px;  
> background-position: 0px 16px;  
> background-color: transparent;  
> border-color: transparent  
> }

---

<div class="post-metadata">

**Author:** ![ianRagudo](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/ianragudo/32/44527_2.png) [@ianRagudo](https://community.developer.atlassian.com/u/ianRagudo)\
**Post date:** [April 16, 2018, 6:34am UTC](https://community.developer.atlassian.com/t/image-not-loading-when-in-admin-pages/17386/2 "2018-04-16T06:34:46Z")

</div>

Hi @mathieu.yargeau,

I do not see any glaring errors on your snippets. I tried it in Jira Server v7.7.1 and was able to successfully load the icon, even in the Jira Administration pages. Is there a specific page that you are experiencing this?

Cheers,  
Ian

---

<div class="post-metadata">

**Author:** ![mathieu.yargeau](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@mathieu.yargeau](https://community.developer.atlassian.com/u/mathieu.yargeau)\
**Post date:** [April 16, 2018, 2:43pm UTC](https://community.developer.atlassian.com/t/image-not-loading-when-in-admin-pages/17386/3 "2018-04-16T14:43:59Z")

</div>

Not in a specific page, it happens in all pages. I also have a similar icon, that I make appear using the same method, in the project navigation sidebar at the left, and that icon disappears too when I enter the project settings page.

I didn’t have any error in the browser console logs when only using the atl.general context, but when I added the atl.admin context, I get a failed to load resource 404 error for both icons.

---

<div class="post-metadata">

**Author:** ![ianRagudo](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/ianragudo/32/44527_2.png) [@ianRagudo](https://community.developer.atlassian.com/u/ianRagudo)\
**Post date:** [April 17, 2018, 6:07am UTC](https://community.developer.atlassian.com/t/image-not-loading-when-in-admin-pages/17386/4 "2018-04-17T06:07:35Z")

</div>

Interesting. Here’s my plugin.xml (which I patterned from yours).

```auto
	<web-item name="MyWebItem" i18n-name-key="my-web-item.name"
		key="my-web-item" section="system.top.navigation.bar" weight="99999">
		<description key="my-web-item.description">The MyWebItem Plugin</description>
		<styleClass>aui-button aui-button-primary</styleClass>
		<label>
		</label>
		<tooltip key="item.tooltip"></tooltip>
		<link linkId="my_item_link">/secure/Something!WebWork.jspa</link>
		<dependency>${project.groupId}.${project.artifactId}:my-item-resources
		</dependency>
	</web-item>

	<web-resource key="my-item-resources" name="my-item-resources">
		<dependency>${atlassian.plugin.key}:jira-web-item-resources
		</dependency>

		<transformation extension="js">
			<transformer key="jsI18n" />
		</transformation>

		<resource type="download" name="my-item.js" location="/js/jira-web-item.js" />

		<context>jira-web-item</context>
	</web-resource>

	<web-resource key="jira-web-item-resources" name="jira-web-item Web Resources">
		<dependency>com.atlassian.auiplugin:aui</dependency>
		<dependency>com.atlassian.auiplugin:aui-experimental</dependency>
		<dependency>com.atlassian.auiplugin:aui-table-sortable</dependency>

		<resource type="download" name="jira-web-item.css" location="/css/jira-web-item.css" />
		<resource type="download" name="images/" location="/images" />
		<resource type="download" name="pluginIcon.png" location="/images/pluginIcon.png">
			<param name="content-type" value="image/png" />
		</resource>
		<context>atl.general</context>
		<context>atl.admin</context>
		<context>common</context>
		<context>jira-web-item</context>
	</web-resource>

```

Here’s what it looks like in one of the administration pages

 ![image](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/6/0/6057ff3f820cc2d7243caa1854e13787b6ec6c73.png)

I also used the auto-generated pluginIcon.png and pluginLogo.png that resides in main/resources/images. Just to cover all the bases when checking this, what Jira version are you working with?

---

<div class="post-metadata">

**Author:** ![mathieu.yargeau](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@mathieu.yargeau](https://community.developer.atlassian.com/u/mathieu.yargeau)\
**Post date:** [April 20, 2018, 4:14pm UTC](https://community.developer.atlassian.com/t/image-not-loading-when-in-admin-pages/17386/5 "2018-04-20T16:14:39Z")

</div>

It’s possible that I had a conflict with another web-resource. I noticed I had a web-resource names “icon resources” and it was downloading those files too. I deleted it and it works now.
