As discussed in #1012878: Add a way to index an entity directly

The current search block uses the facet name rather than the field name.

I personally found this a little confusing and awkward. To help explain why I'd like to expand on how facet/field names are being used:
- The title of the facet blocks when it is being displayed is actually derived from the field name unless it is overridden.
- The current search block uses the facet name if you tick 'Display field name for active filters'. Otherwise it just uses the selected filter value which I am personally not fond of.
- The block title on the block admin page uses the facet name. This makes me hesitant to rename the facet to something I'd like on the search page as it can make it tricky to find the right block if, for example, you renamed it to the name of a vocabulary. Just looking at the block admin page, what would a block called 'Tags' be? In a complex site it'd be very ambiguous.

I like the default facet block names ([index name]: [field name]) on the block admin page - lets me know I'm dealing with Search API facet blocks (and which index it pertains to), so I'd rather not change it. However, they are far from ideal for the current search block. So I am left choosing between block admin difficulty or nice looking current searches.

You have already suggested the option of "instead of a checkbox for "Display field name for active filters" a select that lets you also choose what should be displayed, the field or the facet name". This would be fine with me.
However, I would also be happy with a solution that provided an alternate way of naming the facet blocks.
It'd be a bit more cumbersome for me as a user but it'd work.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drunken monkey’s picture

As said, that makes sense. I can't make any promises, but as this should be relatively easy to fix, I'll probably to it soon.

drunken monkey’s picture

Status: Active » Needs review
FileSize
4.5 KB

The attached patch should provide this.

Shadlington’s picture

Tried this with a bunch of facets and it works - nice! :D

drunken monkey’s picture

Status: Needs review » Fixed

OK, great.
Just committed this – thanks for the suggestion and testing!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.