In our Confluence Cloud Forge app, I added a tab under Space Settings (confluence:spaceSettings), and I would like to add a button to it that when clicked opens another component defined under Global Config (confluence:globalSettings), ideally also passing some state variables. I’m looking for a way to navigate between components defined under different modules, reusing the same React component and showing it under both modules is not an option.
Is there a way to either get an absolute URL that points to a specific component under a specific module, or target a component defined in another module, e.g. by referencing its key? Is this doable in Forge? I see that when I open my component under Global Config, the URL in my browser contains the Forge app id and the key I use when defining my component in manifest.yml, but the URL also contains another key which apparently originates from Forge’s internals. I would not rely on composing URLs like that, there really should be a standard way for doing this, I see no reason why not.
Has anyone been able to solve this? Any suggestions are welcome.
I’m an engineer in Confluence Ecosystem. At the moment we don’t have a better way than manually composing the URLs. To clarify, if the link is clicked, you want the browser to navigate to GlobalSettings module’s page right?
I have created a feature request ticket here.
Thank you for your response and the ticket. Yes, the goal is to navigate to a page in the GlobalSettings module. I have implemented the URL composing workaround for now, but I’m looking forward to replacing it with a standard mechanism once available. Ideally I would like to be able to target any of my components defined under any module, also providing some context that allows me to set the initial state of the targeted component.
@EnginTekin It is surprising that in Forge you can generate a navigation link (URL) from a component in module “A” to a component in module “B”…
Why is it missing? Is this an antipattern? A design flaw? Or what?
As Gabor wrote, the manual URL composition trick can work in simple situations, but we couldn’t figure out how to pass variables as part of the URL. Do you have a tricky solution for that?