Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/components/VersionIframe/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ const VersionIframe: React.FC<VersionIframeProps> = ({
const mainUrlParams = new URLSearchParams(window.location.search);
if (mainUrlParams.has('pageid')) {
url.searchParams.set('pageid', mainUrlParams.get('pageid'));
const pageId = mainUrlParams.get('pageid');
const pageIdSplit = pageId.split('__');
if (pageIdSplit.length > 1) {
// Tutorials module pages have pageids like {subdirectory}_{real_url_ending}, must be split to generate matching URL
const completePath = `tutorials/${pageIdSplit.join('/')}/`;
url.pathname += completePath;
} else {
// Other pages are not tutorials with subdirectories, so just add the pageid
url.pathname += `${pageId}/`;
}
} else if (mainUrlParams.has('pageId')) {
url.searchParams.set('pageid', mainUrlParams.get('pageId'));
}
Expand Down
Loading