Question

I've recently created a site but have run into a problem with the navigation bar. My problem is I want to be able to filter out displaying links.

This is because part of my site makes use of books. As part of the site allows the user a choice of 4 links which link to 4 different books and they can progress through those books as you would expect.

Currently, a link to each page is shown at the bottom of the page. What I would like to do is filter these links so it only shows rel event links to a user, e.g. if they are on book1 it shouldn't show links to book 2 and 3 and their children pages as it currently does.

Any ideas?

Was it helpful?

Solution

I think you have used the Menu module to create the links. If you use Book module ( which is in core you need to just enable it). It will help you create hierarchical menu as in your requirement. The menu created by book module looks like the one on this page ( the relevant navigation menu ).


Update: book navigation creates its own menu on the relevant book pages. And it is context sensitive. As you can see from the above example, depending on the page you are viewing, it displays sibling menu ( i.e. pages that are on the same level as the current one ). And also next and previous buttons along with go one level up links.

I suggest in your main menu you create only entries to reach to the Book. For example let you have three books, Book1, Book2 and Book3.

In your main menu create three entries pointing towards these three book. ( Delete all the entries coming from pages in book.)

After that enable book module in core and use the book module to manage the content type used to create book pages. Design your hierarchy using book modules menu system for book pages.

Again this link gives you an excellent documentation regarding using menu system for book.

PS: The method i described is easier than using other method like context and views to create the same functionality that book module provides out of the box.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top