Non-Linear Content in Fixed-Layout ePub
In my new version (in progress) of Megalithic Landscapes, an 'Index' button is available on every page.
Update: As of IOS 9 and iBooks 4, I don't recommend that you try to get non-linear content to work. You will be able to use the popup as described below here, but the display on iBooks for MAC is not good; you will find that the height of the popup will fill the screen. Even if you have an html document set (in the spine) to be 'non-linear' iBooks 4 will show the page when the reader reaches that point in the book.
Being able to link to content within an eBook package but not have that content navigable by any other means is a very useful feature supported in re-flowable eBooks within the iBooks app on Apple iOS devices.
In my book on eBook Typography for Flowable eBooks, I demonstrate this feature for tables, scrolling text and even PDFs. Unfortunately, it was not possible to use this feature in fixed-layout ePub eBooks destined for the iBooks app.
Or so I thought! I have recently discovered that the latest version of the iBooks app on iOS7 does support it even though, Apple's own documentation says that it does not!
Edit: See below - it does work on earlier versions of iBooks /iOS
Why would you want non-linear content?
The main reason is that it allows you to provide relevant material without forcing the user to break permanently out of the flow of their reading. Once the material is viewed then click the 'cross' in the top left (or double tap), and you are taken right back where you were reading.
In the example shown, another good reason is demonstrated; link to an interactive index, and you can provide the means to navigate anywhere within the book.
How does it work?
There are 2 important aspects to this:
In the package opf file of my eBook Megalithic Landscapes, the spine item needs to be identified as outside the normal flow like this:
<itemref idref="notes" linear="no"/>
<itemref idref="site_index2" linear="no"/>
The last 2 items should not be available to the reader except through an internal link. In my item 'notes' - this refers to an HTML document that contains my version notes and portions are shown when the note reference is clicked. This produces the popup text as seen in the last image here. A popup is produced by using the epub:noteref link like this:
<a epub:type="noteref" href="endnotes.xhtml#v1">Version 1.1</a>
The above seemed to work without a problem in iBooks 3.2 for iOS7. The page endnotes.xhtml is not visible at the end of the book. I was surprised by this, because the documentation suggests that non-linear content is not supported in fixed layout ePub.
Content from other links
What if we could link to something outside the normal flow? Would that work? Various experiments were frustrating and I could only ever get a blank page - even though the cross was in the top left. Then I hit upon an idea that seems to go back to an earlier generation of web hyperlinking; target a new window.
Here is the HTML markup that links from the bottom of every page:
<a href="site_index2.xhtml" target="_blank">Index</a>
Yes, of course there would be some issues!
- This does not work properly in iBooks for MAC OSX Mavericks. The pages are available at the back of the book. The question is - can we deliver a different version to iBooks for MAC?
- This version of Megalithic Landscapes is not in the iBooks store, so it could well be rejected by Apple!
Note: The resulting ePub does validate.
Update: I managed to get access to a first generation iPad and have tested this on iOS 5 with iBooks version 3.02. It does work, although the non-linear page seems to have a light gray overlay - usable though. See the final image. Thanks to @elmimmo_ for pointing this out.
Posted on 01 Jan around 3pm