Closed (fixed)
Project:
Search API
Version:
8.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Jun 2021 at 23:32 UTC
Updated:
10 Apr 2023 at 13:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
vector_ray commentedHow about this?
Comment #3
vector_ray commentedComment #4
seutje commentedWorks for me, but I'm not sure if hardcoding the wrapper is the way to go. Is there no way to just run this through the regular field mechanics so you can use a template?
Comment #5
drunken monkeyYou’re right, that is less than ideal. Thanks a lot for reporting this problem.
However, while I unfortunately know very little about the rendering/theming process in Drupal, I’m with seutje in thinking that hard-coding the wrapper div doesn’t seem like a very “clean” way of fixing this.
Any suggestions for making this “cleaner”, such that, e.g., themes could override the markup? Can/Should we provide a template for this?
Comment #6
seutje commentedAdded a template for it. Not sure about the classes because this could create confusion about the template to override, as it isn't really part of the field API...
Comment #7
seutje commentedFixed copy/pasta mistake in the template code comments.
Comment #8
drunken monkeyThanks a lot! To my non-themer eyes, this looks like a pretty good solution.
Could anyone else affected by this problem (or with more theme layer knowledge) test and review as well?
Comment #9
drunken monkeyAnyone able to review? Would be good to get feedback here to make sure this is actually an improvement.
Comment #10
marios anagnostopoulos commentedHello there,
I know that lucene backends provide ways to request the results pre-wrapped.
Besides that though, the DB backend (and probably others as well) don't, so that's a nice addition.
With Drupal's theming principles in mind, the patch is sound and it should remove (minor but still) headaches when needing to theme the highlighter results.
All in all, looks good.
Comment #12
drunken monkeyGood to hear, thanks a lot for reviewing!
Committed.