How do I add an icon for my Stash 3.x plugin web-item?

Graham Lea April 5, 2015

I have a Stash 2.x plugin I am upgrading to Stash 3.x. My plugin is mainly exposed through a web-item on the 'stash.repository.nav' section.

Stash 3 introuced the sidebar, where each web-item has an icon.

I've seen several suggestions for getting an icon to work for my plugin, but none of them work completely.

The closest I have got is by adding this to my <web-item> definition:

&lt;param name="stashIconClass"&gt;myplugin-sidebar-icon&lt;/param&gt;

and this to my plugin's CSS:

.myplugin-sidebar-icon {
    background-image: url('images/marketing/myplugin-logo-16.png');
}

This works, but only when I am in the plugin's tab. When I'm on any other tab for the repository, the logo doesn't show up.

So... what is the canonical way that a web-item plugin should be adding a logo to the sidebar?

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Mike Friedrich
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2015

You need to add the correct context to the web-resource which contains your css.

E.g. 

&lt;context&gt;jira.general&lt;/context&gt;

Well, a stash context ofcourse. I assume, one from here: https://developer.atlassian.com/stash/docs/latest/reference/web-resource-contexts.html

0 votes
ThiagoBomfim
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 26, 2015

Hi Graham,

As an alternative to your plugin, have you seen the one below?

Best,
Thiago

 

TAGS
AUG Leaders

Atlassian Community Events