MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   ePub (https://www.mobileread.com/forums/forumdisplay.php?f=179)
-   -   Adding "folders/categories" in a TOC (https://www.mobileread.com/forums/showthread.php?t=339680)

Detroa 05-27-2021 01:01 PM

Adding "folders/categories" in a TOC
 
Hello everyone,

First of all, sorry if this has been asked already but I couldn't find a solution using the search feature.

I want to add some "titles/folders/categories" in my TOC without having them pointing to anything. I just want to add them to sort my TOC entries in a certain way. To make things clearer, here's what I wanna do:

>Chapter 1 (pointing to chapter1.xhtml)
>Title/folder/category 1 (not pointing to anything, just there for sorting purpose)
>>Chapter 2 (pointing to chapter2.xhtml)
>>Chapter 3 (pointing to chapter3.xhtml)
>Chapter 4 (pointing to chapter4.xhtml)

I tried to achieve this by simply placing my chapters 2 and 3 <navPoint> tags in a <navPoint> with <navLabel> and <text> but no <content> tag and it seems to be working (tested in ADE) but when I open the TOC in Calibre, a red dot appears instead of the usual green V next to the Title/folder/category 1 entry so I suspect my solution could be a problem on some devices.

Is there a better way to achieve this?

Thank you a lot in advance for your help.

JSWolf 05-27-2021 01:05 PM

I still don't get exactly what it is you want. Your NCX ToC has to have every entry pointing to someplace valid.

theducks 05-27-2021 03:39 PM

Jon is correct. Only valid entries

Point your 'Part' (folder) to Chapter2.xhtml
and Just Point the chapter entry to an Anchor inside the body.
Chapter2.xhtml#top
They will both LAND at the same place, but having an anchor for the second bit prevents it being called a 'duplicate'

Detroa 05-27-2021 04:40 PM

Thank you for your answers.

Making the "folder" entry point to a specific place of the book wouldn't make sense for the reader because the various entries I want to put in it are disseminated all over the book.

How about using <content src="toc.ncx"/> for the folder entries? That way, it points to something that does exist, it removes the errors in the Calibre TOC editor and the reader won't be redirected anywhere if he taps it. Do you think that solution could be problem on some devices?

JSWolf 06-01-2021 09:05 PM

Quote:

Originally Posted by Detroa (Post 4125307)
Thank you for your answers.

Making the "folder" entry point to a specific place of the book wouldn't make sense for the reader because the various entries I want to put in it are disseminated all over the book.

How about using <content src="toc.ncx"/> for the folder entries? That way, it points to something that does exist, it removes the errors in the Calibre TOC editor and the reader won't be redirected anywhere if he taps it. Do you think that solution could be problem on some devices?

That won't work.

Hitch 06-02-2021 10:16 AM

Quote:

Originally Posted by Detroa (Post 4125307)
Thank you for your answers.

Making the "folder" entry point to a specific place of the book wouldn't make sense for the reader because the various entries I want to put in it are disseminated all over the book.

How about using <content src="toc.ncx"/> for the folder entries? That way, it points to something that does exist, it removes the errors in the Calibre TOC editor and the reader won't be redirected anywhere if he taps it. Do you think that solution could be problem on some devices?

As Jon said above, that won't work.

I still don't understand WHAT you are trying to do. With all due respect, from what you've said thus far, it doesn't make any sense.

You say that the puprose of the folders is to "sort your TOC in a certain way." Uh...why not order the TOC in that way, in the first place? What's the POINT of the folder, exactly? If the folder is nothing but a placeholder, why not use parts and group your TOC *as you want it*? Why...can you give an actual example, that might make sense to us? You're not getting much play here, because nobody understands the WHY or even the WHAT of waht you want to do. A real example would be helpful.

Or make one up, using Dog Breeds as an example, or something...

Hitch

Jellby 06-02-2021 11:16 AM

I think the idea could be something like:

Spine order:
- Day 1
- Day 2
- Day 3
- Day 4
- Day 5

"Folder" TOC:
* Fun days
- Day 1
- Day 4
* Boring days
- Day 2
- Day 3
- Day 5

Where "-" are real links to actual sections in the book, and "*" are just TOC items that can be expanded/collapsed, but don't point anywhere in the book, because there's no appropriate place.

KevinH 06-02-2021 11:49 AM

Maybe use an index.xhtml or create an html toc and edit it any way you want?
The actual TOC (Nav or NCX) is supposed to be machine readable and the playorder reflects the spine order. Html tocs outside the nav do not have this constraint.

Hitch 06-02-2021 12:29 PM

Quote:

Originally Posted by Jellby (Post 4126766)
I think the idea could be something like:

Spine order:
- Day 1
- Day 2
- Day 3
- Day 4
- Day 5

"Folder" TOC:
* Fun days
- Day 1
- Day 4
* Boring days
- Day 2
- Day 3
- Day 5

Where "-" are real links to actual sections in the book, and "*" are just TOC items that can be expanded/collapsed, but don't point anywhere in the book, because there's no appropriate place.

That's why God in Her Infinite Wisdom created toc.html files and yes, indices. (smile). That's the only viable solution. I'd do a toc.html and drop it in; it's something that readers expect to see, so they would probably use it.

Hitch

JSWolf 06-02-2021 08:00 PM

Quote:

Originally Posted by Hitch (Post 4126781)
That's why God in Her Infinite Wisdom created toc.html files and yes, indices. (smile). That's the only viable solution. I'd do a toc.html and drop it in; it's something that readers expect to see, so they would probably use it.

Hitch

I delete the HTML list of links that some call a ToC. :rolleyes:

It is a lot easier to use the NCX ToC. Why should I select the NCX ToC and then have to go to the HTML ToC when I already am in the ToC?

Hitch 06-02-2021 08:28 PM

Quote:

Originally Posted by JSWolf (Post 4126874)
I delete the HTML list of links that some call a ToC. :rolleyes:

It is a lot easier to use the NCX ToC. Why should I select the NCX ToC and then have to go to the HTML ToC when I already am in the ToC?

Yes, Jon, I know you do. But for some purposes--like THIS one, specifically--there is little choice.

Hitch

DNSB 06-02-2021 09:20 PM

Quote:

Originally Posted by JSWolf (Post 4126874)
I delete the HTML list of links that some call a ToC. :rolleyes:

It is a lot easier to use the NCX ToC. Why should I select the NCX ToC and then have to go to the HTML ToC when I already am in the ToC?

Jon, in this case where the OP wants to place entries in the ToC in ways that are not permitted in the epub2 toc.ncx or epub3 nav.xhtml document, I don't see much as choice other than using a HTML ToC.

JSWolf 06-03-2021 05:29 AM

Quote:

Originally Posted by DNSB (Post 4126897)
Jon, in this case where the OP wants to place entries in the ToC in ways that are not permitted in the epub2 toc.ncx or epub3 nav.xhtml document, I don't see much as choice other than using a HTML ToC.

I was thinking about this and I might have a solution.

In the NCX ToC,where space is wanted, put in an entry with non-breaking spaces and then point it to the same place (but using an ID) as the entry blow this. If this works, it will show as a blank line and if select it, it will go to the same place as the one below.

JSWolf 06-03-2021 05:39 AM

1 Attachment(s)
I've tried my idea about the NCX ToC and it works.

Attachment 187458

Hitch 06-03-2021 12:34 PM

Quote:

Originally Posted by JSWolf (Post 4126985)
I've tried my idea about the NCX ToC and it works.

Attachment 187458

Jon:

That's good to know, but I believe that the querent wanted to reorganize and reorder the items inside the "folder," as in Jellby's post, above and that's the part where the cow eats the cabbage--trying to "fool" with an NCX out of order.

See what I mean?

Hitch


All times are GMT -4. The time now is 08:10 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.