Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modify tab url based on given parent url (#1731)
This pr is made in tandem with the [theme changes](yext/answers-hitchhiker-theme#1067) to support iframe experience's tab navigation where opening one in a new browser tab should still be under the domain of the iFrame's parent for the new page's url. if a `_parentUrl` is provided, the tabs are updated with their href having the domain of the parent url and a verticalUrl param attached to indicate which page to navigate to. The target is also updated to '_parent' to handle the case of tab navigation in the same browser tab. a function `setParentUrl` is added to the navigation component for user to set `_parentUrl`, which will cause a rerender of the component to update the tabs's link J=SLAP-2089 TEST=manual Tested along with the changes in theme. Deployed two test sites in storm, with [one being from the theme dev branch](https://devtabnaviniframe-theme-slapshot-pagescdn-com.preview.pagescdn.com/?query=virginia&referrerPageUrl=) that points to the SDK pr dev branch, under the staging commit: dev/tab-nav-in-iframe[@65f09b10](yext/answers-hitchhiker-theme@65f09b1). That is used in the src script of iframe_test.html of the [other site](https://devyttesting-theme-slapshot-pagescdn-com.preview.pagescdn.com/?query=virginia&referrerPageUrl=) under the staging commit: dev/yt-testing[@517e852f](yext/answers-hitchhiker-theme@517e852). Navigate to different tabs in the same tab and opening them in new tab. See that the page is still under the domain of the iFrame's parent.
- Loading branch information