Handle page navigation | Community
Skip to main content

Handle page navigation

  • January 25, 2022
  • 2 replies
  • 0 views

Hello,

I'm developing top bar & background located app and looking for way how to handle that agent have opened (not create, just open existing record) ticket's or user's detail. Or just simple handle any page navigation changes.

Thank you in advance for your help.

Best Regards,

Matus

 

 

 

2 replies

Guided
  • January 27, 2022

Hey Matus,

You can't really see where the agent is navigating, as the apps are inside (sandboxed) iframes.

What you can do it make your app available for the ticket_sidebar, user_sidebar and organization_sidebar locations. You don't add any UI there, you hide the app.

Then you setup communication between the sidebar locations and your background, there's a sample here, where a sidebar gets control over the top_bar:
https://developer.zendesk.com/api-reference/apps/apps-core-api/client_api/#clientinstanceguid

You can trigger logic and send data to the other instance/location. In this case what ticket/user/organization the agent is looking at.
https://developer.zendesk.com/api-reference/apps/apps-core-api/client_api/#clienttriggername-data


  • Author
  • January 27, 2022

Hi Sebastiaan,

Thank you for your help. I already found solution of this problem and it's very similar to your.

As you mention I extended my app of ticket_sidebar & new_ticket_sidebar locations. After they get activated they call client.get('ticket.id') and broadcast this info to top_bar location over BroadcastChannel (https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel).

Best Regards,

Matus