0

On Drupal 10, I have copied and modified the book-navigation.html.twig file to my custom subtheme "templates" folder (/themes/custom/my_subtheme/templates/book-navigation.html.twig).

This book navigation is perfectly displayed at the bottom of my book pages when logged as admin (the template file seems to be appended just after the "content" part of the node). But when I check my website as an anonymous user, nothing is even printed in the source code.

What I have tried so far :

  • Clear cache
  • List item
  • Rebuild permissions Changed template file permissions from 644 to 664
  • Checked that the content types used for the book are visible to anonymous users

Does this have something to do with the template_preprocess_book_navigation() function which should also be mentionned in my subtheme?

Thank you by advance for your help! Clément

6
  • Do your anon users have sufficient permissions to view that content?
    – Hudri
    Feb 2 at 16:08
  • Yes, I am sure that it is the case. My books are made of "Basic Page" contents which are fully viewable to anonymous users. The content of these pages is displayed. It is only the book navigation part that is missing when logged-out. Feb 2 at 18:23
  • Has this content been cached by a forward proxy, or perhaps, by the browser?
    – cilefen
    Feb 2 at 18:35
  • @cilefen I don't think so. I am testing as an anonymous user on an Opera browser where I have cleared the data cache several times. Same for my Drupal cache. Feb 2 at 18:40
  • I have just noticed another strange behavior: I have two books on my website, and the book navigation is actually visible for anonymous users on one of these books! I don't understand why it doesn't show under the other one... I don't recall it is needed to enable the book navigation individually for each book. Or am I wrong? Feb 2 at 18:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.