localgovdrupal / localgov_search

Default sitewide search implementation for LocalGov Drupal.
GNU General Public License v2.0
0 stars 1 forks source link

Search results template / styling #39

Closed finnlewis closed 1 year ago

finnlewis commented 2 years ago

We currently have no consistent display for search results in LocalGov Drupal

https://demo.localgovdrupal.org/search?s=council

We need to

Work from Waltham Forest might be useful, at least for LocalGov Services.

See https://www.walthamforest.gov.uk/search?search=birth

finnlewis commented 2 years ago

@markconroy @msayoung @richard-s-rowley @willguv

Any thoughts on how to define consistent display modes for search results?

markconroy commented 2 years ago

I'm a big fan of single templates for single view modes that can then be used across all content types. So ... my preference - same as teaser, card, etc - would be to have a template in localgov_base called node--search-result.html.twig and we put the layout in there. Then all content types will have the same layout.

If a content type in a module has a more specific template - like node--event--search-result.html.twig we can easily create the same template in our theme and set it to {% include <our-theme-template>html.twig %} (like we are doing withnode--news--teaser.html.twig`

P.S. Those Waltham Forest search results look really nice.

ekes commented 2 years ago

Worth noting the WF live version are fields output not entity output; but the module they supplied does suggest method for the same using entity output. The bigger part there being making the view modes for search results with the custom output (eg. Services landing pages highlighting particular listed pages).

finnlewis commented 2 years ago

I've created an issue in each project that provides a content type, so we can address each there and perhaps get help from others,

markconroy commented 2 years ago

We've currently got this template - https://github.com/localgovdrupal/localgov_base/blob/1.x/templates/content/node--search-result.html.twig - for node--search-result.html.twig, but it's just a very basic node template.

It would be worth laying it out something like our teaser template - image left, title/content on right or similar.