Please take a look at our overview of how and why you should include Javascript and CSS resources into your plugin. The page below gives specific details of the Web Resource plugin module type.

Including your web resource in a specific context

In Confluence 2.10 we added the ability to specify web resources like CSS and JavaScript to be included in specific contexts of Confluence. Please see below for the currently available contexts and more information.

On this page:

[Unable to render {include} The included page could not be found. ({include} をレンダリングできません。ページが見つかりませんでした)] を選択し、

Web Resource Contexts

In Confluence 2.10 we added the ability to specify web resources like CSS and JavaScript to be included in specific contexts of Confluence. The currently available contexts are:

  • admin
  • main
  • ダッシュボード
  • エディタ
  • ページ
  • blogpost
  • スペース

To configure your web resource to be included for example in the 'space' and 'page' contexts you add <context> child elements to your <web-resource> element in your atlassian-plugin.xml:

<web-resource name="Resources" key="resources">
        <resource name="foo.js" type="download" location="resources/foo.js">
        </resource>
        <context>space</context>
        <context>page</context>
</web-resource>

Using web resource contexts is a great way to provide plugins that dynamically create HTML using JavaScript. At Atlassian we built a plugin which listens to a particular keyboard shortcut to open a little search box on top the Confluence UI.

関連トピック

Adding Plugin and Module Resources
Including Javascript and CSS resources
Writing Confluence Plugins
Installing and Configuring Plugins Manually

Information sourced from Plugin Framework documentation

  • ラベルなし