double Posted May 30, 2022 Share Posted May 30, 2022 I'm looking for a book module alternative for creating structured documents. If you don't know about Book module of Drupal, follow this link: http://drupal.org/documentation/modules/book Also I'm looking for a module like html2book, which allows you to create multi-page books by splitting the body text of a book page node into multiple nodes upon save (split points are html tags) Link to comment Share on other sites More sharing options...
Robin S Posted May 30, 2022 Share Posted May 30, 2022 I don't think there is any module that does exactly what you're asking about, but I expect it wouldn't be that hard to achieve without needing any module. We probably need to hear a longer explanation of what you're wanting to do. If the pages of the "book" can be grouped together in the tree in the form... Book title - Chapter ...or... Book title - Chapter -- Subsection --- etc ...then you can create your navigation links using $page->children(), $page->next(), $page->prev() etc. Or if the pages are scattered throughout the site but need to be grouped together for use in a book then you can use a Page Reference field to select all the pages that make up the book. As the book is browsed you can keep track of the fact the visitor is viewing the pages as a book by passing a URL parameter on each navigation link like ?book=my-book-title and this will let you work out the previous and next pages for use in the navigation. 5 hours ago, double said: Also I'm looking for a module like html2book, which allows you to create multi-page books by splitting the body text of a book page node into multiple nodes upon save (split points are html tags) If you want to divide the long text into multiple pages on save then you can use a Pages::saveReady hook to parse the HTML and find the tags that you want to split on, then create new pages with the split content using the API. Or if you want to keep the long text in one piece but paginate it on the front-end then you could take a look at TextformatterPagination. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now