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

CSS resource not being included in Stash web-item plugin module

Annie April 3, 2013

I've got the following Stash plugin module definition:

<web-item key="header" name="My Header" weight="40" section="header.global.secondary">

<styleClass>total</styleClass>

<tooltip>Total</tooltip>

<resource type="download" name="total.css" location="css/total.css"/>

<condition class="com.atlassian.stash.web.conditions.IsLoggedInCondition"/>

<context-provider class="plugin.contextproviders.TotalContextProvider"/>

<label>$total dollars</label>

</web-item>

However, when I start up Stash (atlas-run) the styling I've included in total.css (making the background-color red) isn't being applied. I can't see the total.css file included anywhere when I use Chrome Dev Tools to try and find it, and the style applies fine if I manually edit the css in Chrome Dev Tools.

Any idea why the style isn't being applied and why I can't see the CSS being downloaded/included anywhere?

1 answer

1 accepted

0 votes
Answer accepted
cofarrell
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 4, 2013

Hi Annie,

I'm afraid to say that it appears that web-items don't support download resources. You'll have to add the resource another way. You could do that with with an extra web-resource (or stash-resource) with a context (like global or atl.general).

Cheers,

Charles

Annie April 4, 2013

Awesome, I added a web-resource with atl.general context and it works as I want it to :) Thanks!

seb
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 4, 2013

Hi Annie,

Using atl.general is not recommended, as it adds your resources to every page in Stash. Unless you actually need to target every page, please take a look at https://developer.atlassian.com/stash/docs/latest/reference/web-resource-contexts.html for a more appropriate context (nb: atl.general does not hit admin pages)

Annie April 4, 2013

Hey Seb, thanks for the advice. I do actually need it to display on every page - so I guess I should apply it to the atl.general *and* atl.admin.

cofarrell
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 5, 2013

Hi Annie,

Adding both contexts to your resource is correct then.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events