Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×I can't reference my own CSS-file. It is defined in src/main/resources/css. What do I need to to include in my html-code (vm-file) and where has it to be included?
Can you please give a code sample? Usually you put <link rel="stylesheet" type="text/css" href="formate.css"> into the header.
I've already defined the css-web-resource, but how do I connect it to the link tag? Or somehow else?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The page describes 3 options. I would recommend one of two:
1. use webResourceManager.requireResource
2. include the resource in the context of the page
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, I understand. You don't need the link tag in the header of the html-file.
You simply define your web-resource (do not forget context!!!) in atlassian.xml:
<web-resource key="key-Name" name="name Resource"> <dependency>com.atlassian.auiplugin:ajs</dependency> <resource type="download" name="my-listener-plugin.css" location="/css/my-listener-plugin.css"/> <resource type="download" name="my-listener-plugin.js" location="/js/my-listener-plugin.js"/> <resource type="download" name="images/" location="/images"/> <context>your-context</context> </web-resource>
And then you reference this context, by putting following line of code into the header of the html-file:
$webResourceManager.requireResourcesForContext("your-context")
That's how it works. By referencing this context, you also have access to all other resources defined in your web-resource like js, images, ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.