Deep links are hyperlinks that connect to specific content on a web page. You can create deep links to various types of content with InDesign and in5.
Deep linking to a specific page in your output
If you export your InDesign layout with Output set to Web in the Basic section of the Export HTML5 with in5 dialog (in5 > Export HTML5 with in5...), then in5 generates a single index.html page that contains all of the pages of your document. To link to a specific page within that single index.html file, use the following syntax:
index.html#p=2
The example above would take you to page 2.
Because you don't need to include the index.html, the full URL could also look like this:
http://example.com#p=2
Alternatively, set Output to Multi-page Web with some page formats to export individually numbered HTML files so that each page has a unique URL.
For more information, see:
Deep linking to page added to a WordPress site
To make a link that goes to a specific page that has been added to WordPress, append the page number using the syntax below if the content was exported with Output set to Web:
<iframe ... src="https://example.com/wp-content/uploads/in5-archives/index.html#p=2" ...></iframe>
or use the HTML filename if it was exported with Output set to Multi-page Web:
<iframe ... src="https://example.com/wp-content/uploads/in5-archives/0002.html" ...></iframe>
To be able to share a link that would open the website but also load a specific page in the iframe as the first page, add the following code to the JavaScript portion of the Resources section of the Export HTML5 with in5 dialog:
function getHashPage(){ var q=(location.hash || parent.location.hash).substr(1),px=q.indexOf('p='); return px>-1?parseInt(q.substr(px+2))||-1:-1; }
With this function, adding the hash parameter to the top URL will load page 3 of the document in the iframe.
https://example.com#p=3
(The above script and URL work when there is only one iframe on the page.)
Deep linking within embedded content
When you embed content using the in5 Web Content interactive widget (in5 > Interactive Widgets > Web Content), in5 places that content in an iframe for you.
To add a deep link, you can add a name attribute to the iframe and then in the link, add that name as the target.
Here's more information:
- https://www.w3schools.com/html/html_iframe.asp (see Iframe - Target for a Link)
- https://www.w3schools.com/html/tryit.asp?filename=tryhtml_iframe_target