Chapter/Section Lists
March 8, 2019 12:00 AM
Is there a way to access a list of all chapters and sections in a title? I don't see a reserved variable for it.
undefined
There's current chapter name, current section name, total pages in section, and total pages in chapter. But.. is there a way, from any page in the title, to query for a list of ALL chapters/sections?
If not, I'm heading right over to the suggestions forums!
Discussion (4)
Are you talking about for an end user to access a list of chapters/sections? If so, then adding a Table of Contents would work (e.g. table of contents, and then under properties - 'included Pages' just identify the chapters/sections you want available.
I'm trying to avoid having to create these variables on a per course basis as I am building a custom navigation menu using HTML, CSS, and JavaScript that will be used in a course template for many courses going forward. If I could easily pull the course/section names in their entirety on any given page (as the menu is dynamically built with code on each page), this would allow me to populate the menu chapters/sections based entirely on the names of the chapters/sections as entered by the course designer inside Lectora.
I have thought about putting the Table of Contents object on the page and digging it out of the HTML text nodes generated by the TOC, but I worry that this will be messy. I'm thinking it'll have go to into the suggestion box :|
No, unfortunately I'm not thinking about displaying it to the user. I was more looking for a way to gain access to a the chapter/section breakdown programmatically. It would be great if there was a reserved variable that contained the names of all of the sections/chapters.
I see - so you need something you would access often enough making it too much trouble to just create your own variables for the Chapters / section names?
Discussions have been disabled for this post