How to limit my plugin in some pages of bitbucket?

Hi experts,

I’m developing a bitbucket plugin using web-panel like below:

<web-panel key='announcement-panel' location='bitbucket.web.repository.banner'>
        <context>bitbucket.page.repository.filebrowser</context>
        <resource name="view" type="soy"
                  location="${atlassian.plugin.key}:pipeline-repo-overview-stats/repo.overview.repoOverviewStats"/>
        <dependency>${atlassian.plugin.key}:pipeline-repo-overview-stats</dependency>
    </web-panel>

It will be displayed in any pages of bitbucket.
I wonder how to limit it only be displayed in bitbucket.page.repository.filebrowser page?

Thanks/Sai

One way is to use a condition that validates the context of the page and use that to show / hide the web panel. So instead of <context> you would have something like:

<condition class="foo.bar.isFileBrowserCondition"/>

Then in the condition, you need to implement the shouldDisplay to validate from context if it should return true or false.

1 Like

Thanks @jan, I will have a try this solution. :slight_smile: