Parent item (book/chapter) tag classes #4963

Closed
opened 2026-02-05 09:29:53 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @sws-noahdoersing on GitHub (Sep 25, 2024).

Describe the feature you'd like

As mentioned on https://www.bookstackapp.com/docs/admin/hacking-bookstack/, BookStack sets classes on a page's HTML <body> element depending on which tags are assigned to that page (for a tag "Priority: Critical", the classes tag-name-priority tag-value-critical tag-pair-priority-critical are added).

This is incredibly handy for styling and could be extended to encompass book and chapter (e.g. for a book "Servers" a class like book-servers).

Describe the benefits this would bring to existing BookStack users

Assigning different styles based on book and chapter would improve customization options.

Can the goal of this request already be achieved via other means?

Not that I'm aware of (except tagging everything with book/chapter titles, which isn't practical or maintainable).

Have you searched for an existing open/closed issue?

  • I have searched for existing issues and none cover my fundamental request

How long have you been using BookStack?

3 months to 1 year

Additional context

No response

Originally created by @sws-noahdoersing on GitHub (Sep 25, 2024). ### Describe the feature you'd like As mentioned on https://www.bookstackapp.com/docs/admin/hacking-bookstack/, BookStack sets classes on a page's HTML `<body>` element depending on which tags are assigned to that page (for a tag "Priority: Critical", the classes `tag-name-priority tag-value-critical tag-pair-priority-critical ` are added). This is incredibly handy for styling and could be extended to encompass book and chapter (e.g. for a book "Servers" a class like `book-servers`). ### Describe the benefits this would bring to existing BookStack users Assigning different styles based on book and chapter would improve customization options. ### Can the goal of this request already be achieved via other means? Not that I'm aware of (except tagging everything with book/chapter titles, which isn't practical or maintainable). ### Have you searched for an existing open/closed issue? - [X] I have searched for existing issues and none cover my fundamental request ### How long have you been using BookStack? 3 months to 1 year ### Additional context _No response_
OVERLORD added the 🔨 Feature Request label 2026-02-05 09:29:53 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Sep 26, 2024):

Thanks @sws-noahdoersing,
Personally I wouldn't be too keen on using book names for this, since they're likely to change and would only serve as one potential label/class to be used, but I'd be potentially open to having tag classes reflect parent book/chapter tags, so like book-tag-pair-priority-critical, chapter-tag-pair-priority-urgent.

That way you could tag multiple different books with a tag for specific tweaks/customization for all pages within those books, and it keeps the advanced customization functionality within the scope of tags.

@ssddanbrown commented on GitHub (Sep 26, 2024): Thanks @sws-noahdoersing, Personally I wouldn't be too keen on using book names for this, since they're likely to change and would only serve as one potential label/class to be used, but I'd be potentially open to having tag classes reflect parent book/chapter tags, so like `book-tag-pair-priority-critical`, `chapter-tag-pair-priority-urgent`. That way you could tag multiple different books with a tag for specific tweaks/customization for all pages within those books, and it keeps the advanced customization functionality within the scope of tags.
Author
Owner

@sws-noahdoersing commented on GitHub (Sep 27, 2024):

That's a much better approach, I agree!

@sws-noahdoersing commented on GitHub (Sep 27, 2024): That's a much better approach, I agree!
Author
Owner

@ssddanbrown commented on GitHub (Jul 9, 2025):

Parent tag classes have now been added in #5681, to be part of the next feature release.
Thanks again @sws-noahdoersing for the original request.

@ssddanbrown commented on GitHub (Jul 9, 2025): Parent tag classes have now been added in #5681, to be part of the next feature release. Thanks again @sws-noahdoersing for the original request.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4963