![]() |
#1 |
Connoisseur
![]() ![]() Posts: 59
Karma: 100
Join Date: Aug 2010
Location: Northern California, in the redwoods by the ocean
Device: iPad
|
Syntax for toc.ncx Levels 1 and 2?
Is there a way to code the toc.ncx so that iBooks will display Level 1 AND Level 2, instead of putting everything at Level 1?
Here's a sample of some existing toc.ncx code: <navPoint id="navpoint-5" playOrder="6"><navLabel><text>Breakfasts Plain and Fancy</text></navLabel><content src="CastIronCuisine-6.xhtml#toc-anchor"/></navPoint> <navPoint id="navpoint-6" playOrder="7"><navLabel><text>Apple Fingers</text></navLabel><content src="CastIronCuisine-6.xhtml#toc-anchor-1"/></navPoint> <navPoint id="navpoint-7" playOrder="8"><navLabel><text>Hummelgum</text></navLabel><content src="CastIronCuisine-6.xhtml#toc-anchor-2"/></navPoint> <navPoint id="navpoint-8" playOrder="9"><navLabel><text>Breakfast Lasagna</text></navLabel><content src="CastIronCuisine-6.xhtml#toc-anchor-3"/></navPoint> I want the text "Breakfasts Plain and Fancy" to visualize on the iPad as a Level 1 entry. Apple Fingers, Hummelgum, and Breakfast Lasagna are all recipes that need to appear as Level 2 entries. Can I hand-code this directly? What should be the proper syntax? |
![]() |
![]() |
![]() |
#2 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,527
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
The syntax is:
Code:
<navPoint> (Level 1) </navPoint> <navPoint> (Level 1) <navPoint> (Level 2) </navPoint> <navPoint> (Level 2) </navPoint> </navPoint> |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() ![]() Posts: 59
Karma: 100
Join Date: Aug 2010
Location: Northern California, in the redwoods by the ocean
Device: iPad
|
Jellby, thanks for the syntax. I'll report back whether iBooks honors it.
|
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() ![]() Posts: 59
Karma: 100
Join Date: Aug 2010
Location: Northern California, in the redwoods by the ocean
Device: iPad
|
Jellby, I used the syntax you gave. Ran it by a syntax validator, came out clean. Sent it to epubcheck and it wouldn't validate. Removed the Level 1, Level 2 syntax and got validation. What now? I still feel it's important that Level 2 items be subsumed under Level 1 for visual clarity. But how to make that happen when somewhere my requests to InDesign get lost in transition?
|
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
|
Here's the toc.ncx for a book I uploaded here. It has a 2-level ToC and validates perfectly in epubcheck 1.05.
Converting your code as you described would produce: Code:
<navPoint id="navpoint-5" playOrder="6"> <navLabel> <text>Breakfasts Plain and Fancy</text> </navLabel> <content src="CastIronCuisine-6.xhtml#toc-anchor"/> <navPoint id="navpoint-6" playOrder="7"> <navLabel> <text>Apple Fingers</text> </navLabel> <content src="CastIronCuisine-6.xhtml#toc-anchor-1"/> </navPoint> <navPoint id="navpoint-7" playOrder="8"> <navLabel> <text>Hummelgum</text> </navLabel> <content src="CastIronCuisine-6.xhtml#toc-anchor-2"/> </navPoint> <navPoint id="navpoint-8" playOrder="9"> <navLabel> <text>Breakfast Lasagna</text> </navLabel> <content src="CastIronCuisine-6.xhtml#toc-anchor-3"/> </navPoint> </navPoint> |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Connoisseur
![]() ![]() Posts: 59
Karma: 100
Join Date: Aug 2010
Location: Northern California, in the redwoods by the ocean
Device: iPad
|
Charleski, that is a very beautiful toc. Does it actually play at two levels in iBooks? There's my rub. iBooks seems to be acting strangely if I make my toc too long. Do you have that trouble?
|
![]() |
![]() |
![]() |
#7 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 932
Karma: 15752887
Join Date: Mar 2011
Location: Norway
Device: Ipad, kindle paperwhite
|
I know I'm answering an old thread, but just in case anybody else is looking for answer to this question: I tested this yesterday, and found that iBooks, the viewer in Calibre, Adobe Digital Editions and the Bluereader App both handles at least two levels TOC fine
|
![]() |
![]() |
![]() |
#8 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 184
Karma: 363616
Join Date: Dec 2010
Location: Montreal, Canada
Device: Kobo Original, Kobo Touch
|
I have found out that sometimes epubCheck will give out a lot of errors, that won't prevent your book from being read, so If the result i sacceptable and works with calibre & ADE I don't think there should be any problem.
On another note, try the app in my Sig, it will let you change the Levels of your book without manually editing the toc.ncx (Just drag and drop) |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Page Mapping Using toc.ncx | lorddon | ePub | 35 | 01-16-2018 12:18 PM |
Is there a size limit for TOC.ncx? | osnova | Kindle Formats | 10 | 10-21-2011 01:41 AM |
adding a toc.ncx file to the .prc package | cyberbaffled | Amazon Kindle | 4 | 09-14-2010 02:21 PM |
Can you bypass first two items in TOC.ncx? | sueneu | Kindle Formats | 4 | 07-14-2010 08:36 AM |
toc.ncx playOrder question | aarcane | ePub | 8 | 05-25-2010 05:00 AM |