confluence:pageBanner module and display conditions

Hi i’ve been working on the forge apps recently and would like to know if there is an equivalent of Data Center Confluence’s web-item condition on forge?

Example would be a code that is like this on the atlassian-plugin.xml

<web-item key="my-test-plugin-menu" name="My Test Plugin Menu" section="system.user/user-content">
<label>My Test Plugin</label>
<link linkId="my-test-plugin-menu-linkid">/plugins/servlet/my-test-plugin/home</link>
<condition class="example.confluence.plugins.mytestplugin.conditions.ConditionFunctionChecker"/>
</web-item>

And on forge there is displayConditions(https://developer.atlassian.com/platform/forge/manifest-reference/display-conditions/) however can we also use it for custom functions? So that the function would run first and check if it would display the confluence:pageBanner or any modules supported on displayConditions.

Making a display condition based on the evaluation of a function is a performance mistake. It allows for an arbitrary and inconsistent amount of time to pass before something can be rendered. Therefore we don’t support it in Cloud.

Instead, you should pre-compute your condition and store it in entity/content properties and use that instead. That is supported and does not have performance issues as it’s essentially loading a cached value which takes constant time.

2 Likes

Thanks for pointing that out, I’ll rethink the logic in our forge app and use entity properties for this.

Thanks again @rmassaioli :grinning_face:!

1 Like