How do I get the icon to show on a menu item (web-item) in atlas-plugin.xml?

Taiani Lange March 14, 2017

Hi All,

Currently the following is set in the atlas-plugin.xml.

<plugin-info>
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}"/>
<param name="plugin-icon">images/pluginIcon.png</param>
<param name="plugin-logo">images/pluginLogo.png</param>
</plugin-info>

...

<web-item name="add-draft-label-action-web-ui" key="add-draft-label-action-web-ui" section="system.content.action/primary" weight="10">

<description key="item.add-draft-label-action-web-ui.link.desc">Adds the "Add 'draft' label" action into the Tools menu.</description>

<icon width="16" height="16"> <link linkId="add-draft-label-action-web-ui-icon">/images/icons/pluginIcon.png</link> </icon>

<label key="Add ''draft'' label"/> <link linkId="add-draft-label-action">/plugins/add-draft-label/add-label.action?pageId=$page.id</link>

</web-item>

...

<web-resource key="ClassName-resources" name="ClassName Web Resources">

...

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

</web-resource>

However, the icon does not display in the menu item (web-item) next to the label name.

Also in the admin of the add-on it displays the pluginIcon.png instead of pluginLogo.png.

Please assist.

Thank you in advance.

 

 

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Volodymyr Krupach
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.
March 15, 2017

I guess that you get the sample with "<icon>" tag from Atlassian docs and very often they are obsolete and that's the case with the icon.

I checked the JIRA sources and instead of <icon> tag web-item declare CSS class that adds an icon:

&lt;!-- Create Issue in Epic Header Link --&gt;
    &lt;web-item key="quick-create-issue-for-epic" name="Quick Create Issue for Epic" section="com.pyxis.greenhopper.jira:greenhopper-epics-issue-web-panel/header" weight="1"&gt;
        &lt;label key="quick-create-issue-for-epic-label"/&gt;
        &lt;tooltip key="gh.issue.panel.issues.in.epic.create.issue.in.epic"/&gt;
        &lt;styleClass&gt;icon icon-add16&lt;/styleClass&gt;
        &lt;link linkId="gh-create-issue-in-epic-lnk"&gt;
            /secure/CreateIssue!default.jspa
        &lt;/link&gt;
        ...
    &lt;/web-item&gt;

I recommend you to "reverse engineer" the icon form some existing menu. Find how the appropriate CSS class is declared and apply the same approach.

0 votes
Taiani Lange March 15, 2017

Hi @Volodymyr Krupach

You are correct. My apologies, I was in a bit of a hurry.

I updated the post.

Thank you kindly.

0 votes
Volodymyr Krupach
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.
March 15, 2017

Your question is about the menu item and you have not shown any web-item tag.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events