mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-07-16 05:33:49 +03:00
Modifying header search bar #2757
Closed
opened 2026-02-05 05:02:53 +03:00 by OVERLORD
·
15 comments
No Branch/Tag Specified
development
l10n_development
release
snyk-action
ci_and_static
mfa_key
phpstan_june26
MilnerMart/development
GamerClassN7/impersonations-for-admin
Zhey-on/feature/csp-image-css-controls-6033
tortillas5/development
llm_only
vectors
McTom234/oidc-key-algorithms
captcha_example
v26.05.2
v26.05.1
v26.05
v26.03.5
v26.03.4
v26.03.3
v26.03.2
v26.03.1
v26.03
v25.12.9
v25.12.8
v25.12.7
v25.12.6
v25.12.5
v25.12.4
v25.12.3
v25.12.2
v25.12.1
v25.12
v25.11.6
v25.11.5
v25.11.4
v24.11.4
v25.11.3
v25.11.2
v25.11.1
v25.11
v25.07.3
v25.07.2
v25.07.1
v25.07
v25.05.2
v25.05.1
v25.05
v25.02.5
v25.02.4
v25.02.3
v25.02.2
v25.02.1
v25.02
v24.12.1
v24.12
v24.10.3
v24.10.2
v24.10.1
v24.10
v24.05.4
v24.05.3
v24.05.2
v24.05.1
v24.05
v24.02.3
v24.02.2
v24.02.1
v24.02
v23.12.3
v23.12.2
v23.12.1
v23.12
v23.10.4
v23.10.3
v23.10.2
v23.10.1
v23.10
v23.08.3
v23.08.2
v23.08.1
v23.08
v23.06.2
v23.06.1
v23.06
v23.05.2
v23.05.1
v23.05
v23.02.3
v23.02.2
v23.02.1
v23.02
v23.01.1
v23.01
v22.11.1
v22.11
v22.10.2
v22.10.1
v22.10
v22.09.1
v22.09
v22.07.3
v22.07.2
v22.07.1
v22.07
v22.06.2
v22.06.1
v22.06
v22.04.2
v22.04.1
v22.04
v22.03.1
v22.03
v22.02.3
v22.02.2
v22.02.1
v22.02
v21.12.5
v21.12.4
v21.12.3
v21.12.2
v21.12.1
v21.12
v21.11.3
v21.11.2
v21.11.1
v21.11
v21.10.3
v21.10.2
v21.10.1
v21.10
v21.08.6
v21.08.5
v21.08.4
v21.08.3
v21.08.2
v21.08.1
v21.08
v21.05.4
v21.05.3
v21.05.2
v21.05.1
v21.05
v21.04.6
v21.04.5
v21.04.4
v21.04.3
v21.04.2
v21.04.1
v21.04
v0.31.8
v0.31.7
v0.31.6
v0.31.5
v0.31.4
v0.31.3
v0.31.2
v0.31.1
v0.31.0
v0.30.7
v0.30.6
v0.30.5
v0.30.4
v0.30.3
v0.30.2
v0.30.1
v0.30.0
v0.29.3
v0.29.2
v0.29.1
v0.29.0
v0.28.3
v0.28.2
v0.28.1
v0.28.0
v0.27.5
v0.27.4
v0.27.3
v0.27.2
v0.27.1
v0.27
v0.26.4
v0.26.3
v0.26.2
v0.26.1
v0.26.0
v0.25.5
v0.25.4
v0.25.3
v0.25.2
v0.25.1
v0.25.0
v0.24.3
v0.24.2
v0.24.1
v0.24.0
v0.23.2
v0.23.1
v0.23.0
v0.22.0
v0.21.0
v0.20.3
v0.20.2
v0.20.1
v0.20.0
v0.19.0
v0.18.5
v0.18.4
v0.18.3
v0.18.2
v0.18.1
v0.18.0
v0.17.4
v0.17.3
v0.17.2
v0.17.1
v0.17.0
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.15.3
v0.15.2
v0.15.1
v0.15.0
v0.14.3
v0.14.2
v0.14.1
v0.14.0
v0.13.1
v0.13.0
v0.12.2
v0.12.1
v0.12.0
v0.11.2
v0.11.1
v0.11.0
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.2
v0.8.1
v0.8.0
v0.7.6
v0.7.5
v0.7.4
v0.7.3
0.7.2
v.0.7.1
v0.7.0
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
Labels
Clear labels
🎨 Design
📖 Docs Update
🐛 Bug
🐛 Bug
:cat2:🐈 Possible duplicate
💿 Database
☕ Open to discussion
💻 Front-End
🐕 Support
🚪 Authentication
🌍 Translations
🔌 API Task
🏭 Back-End
⛲ Upstream
🔨 Feature Request
🛠️ Enhancement
🛠️ Enhancement
🛠️ Enhancement
❤️ Happy feedback
🔒 Security
🔍 Pending Validation
💆 UX
📝 WYSIWYG Editor
🌔 Out of scope
🔩 API Request
:octocat: Admin/Meta
🖌️ View Customization
❓ Question
🚀 Priority
🛡️ Blocked
🚚 Export System
♿ A11y
🔧 Maintenance
> Markdown Editor
pull-request
Mirrored from GitHub Pull Request
No Label
🐕 Support
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/BookStack#2757
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xfivesao on GitHub (Apr 19, 2022).
Attempted Debugging
Searched GitHub Issues
Describe the Scenario
Is it possible to adjust the search in the header so that it works the same way as the search for the individual books (sidebar).
I use Bookstack for sporting rules, which are completely identical in many parts and so I get most of the results twice when searching in the header bar.
But I ALWAYS only need one book.
Unfortunately, I'm not a programmer and can't find a way to change the search.
Thanks!
Exact BookStack Version
v22.03.1
Log Content
No response
PHP Version
7.4.29
Hosting Environment
Ubuntu 20.04 IAAS-System (like dedicated server)
@ssddanbrown commented on GitHub (Apr 19, 2022):
Hi @xfivesao,
Just to confirm, the functionality you want is to limit the main search to only show results from a single book?
@xfivesao commented on GitHub (Apr 19, 2022):
Hi @ssddanbrown,
yes, that is totally correct for my specific use case (referee).
We want to use Bookstack in active competition for referees and we want the search to be as accurate as possible.
I have 4 sets of rules (books) that are exactly the same in many parts and when I use the main search I always get 4 hits, although I'm only really looking for one.
The side search ist perfect, but not comfortable to use in stressing moments with a smartphone. Perfect would be a script or switch in the 'Custom HTML head content' section, but unfortunately I am not able to implement it myself.
Bookstack is so fantastic for our purposes and I have been looking for something like this for a very long time.
Thanks for your assistance!
@xfivesao commented on GitHub (Apr 19, 2022):
In case of a competition, the referee chooses BEFOREhand the book he wants to work with for the next hours.
He then definitely does not need the other books or can select another one manually. Never 2 books are searched at the same time.
@ssddanbrown commented on GitHub (Apr 19, 2022):
@xfivesao Okay, Thanks for confirming.
There is no in-built way to limit this search to a specific Book, Nor can I see a workaround that can be applied without editor core application files.
@xfivesao commented on GitHub (Apr 19, 2022):
@ssddanbrown
my first idea (as a non-programmer) was that the header main search simply works like the side bar search after selecting a book (not restricted later to chapters or pages - only on every page the first selected book), and that I can assign with "a hack" of one file or the 'Custom HTML head content' that function to the top search box.
I am aware that I would have to change this again after each update, but it would definitely be worth it to me.
Unfortunately I'm too old an stupid to do so... ;-)
@ssddanbrown commented on GitHub (Apr 19, 2022):
@xfivesao Okay, This is a massive sketchy bodge, but this kind of does what you specified above:
This will check the URL to see if you're in a book and, if so, pass around and use the search term in the book search.
Of course this is not official and could break upon BookStack changes.
@xfivesao commented on GitHub (Apr 19, 2022):
@ssddanbrown
Wow, this is really much more complicated than I thought. Thank you very much!
It works perfectly on PC and is exactly what I need. This improves usability many times over (in my particular case).
On smartphone, however, it does not work as expected. Here, after selecting the book and then selecting the search in the header bar (3 points menu), all results are displayed again.
This seems to work differently with the responsive display. But maybe I can at least fix that on my own.
Thanks a lot for your help!
@ssddanbrown commented on GitHub (Apr 19, 2022):
@xfivesao Ah, yeah, the mobile flow is quite different and searches via a different form/page. Here's an adapted script:
This version will "remember" the last viewed book and use that detail to override both the header search input and the search page search input.
@xfivesao commented on GitHub (Apr 19, 2022):
@ssddanbrown
Dear Dan,
I spent hours trying to get this to work myself, because of course I didn't realize the problem until after I added the 2nd book.
You fixed it perfectly in an hour!
Thank you very much for this - not self-evident - help!
Maybe there will be a version in the future where you can simply select this option in the settings menu. ;-)
Anyway, it works great and is a great added value for me.
Best regards
Ingo
@ssddanbrown commented on GitHub (Apr 19, 2022):
Glad I could help!
To be honest, probably not. This is very specific functionality that would probably be tricky to even just communicate as an option if added as one. Maybe we could make it easier in the future by adding book-scoping filters to the main search, but there's been little other request around this.
I'll therefore close this issue off but feel free to
@me here or chat on our discord server if you need future assistance with the above.@xfivesao commented on GitHub (Apr 19, 2022):
Your app is really fantastic the way it is!
And you have made my special application for the hobby of many of my friends now just perfect!
Thanks again!
@xfivesao commented on GitHub (May 1, 2022):
@ssddanbrown
Hi, we have used your modified app last weekend in a match and your search hack works fantastic with 3 rule books! Thanks again.
My teammates had only one suggestion. Would it be possible to display the results of the modified header search in the same way as in the detail search?
Also with highlighted text of the search term and - especially - with the existing individual tags?
Best regards!
@ssddanbrown commented on GitHub (May 2, 2022):
Hi @xfivesao,
Those will take a lot more complexing hacking to do within the context of your existing workaround, I can't really spend that time right now to support this one-off hack.
There's a case to be made for generally bringing in tags and search term highlighting to the book (and chapter) level search functionality. Would be happy for that to be raised as an additional feature request to be added to core.
@xfivesao commented on GitHub (May 2, 2022):
Hi @ssddanbrown,
unfortunately, I can't estimate the amount of work my questions will cause.
I apologize for that. It is less than a nice-to-have! Everything works exemplary!
I'm not sure I understood your last sentence correctly. Should I open this as a feature request?
@ssddanbrown commented on GitHub (May 2, 2022):
Ah, no need to apologize, didn't mean for my comment to sound too harsh.
Yeah, specifically for "Adding tags and search term highlighting to the book (and chapter) level search", since that probably makes sense to add as an improvement to the core project, and is not limited in scope to your specific workaround.