- Create a view with a search index (e.g., "Default node index" – not "Search index") as the base table.
- Add a "Facets block" display.
- In the block settings, select the field to facet on (in your case, "Content type") and the path of the search you want to link to.
- Set up any additional filters you want on results. Fields and sorts don't have any effect, neither have exposed filters.
- Save the view, enable the block and set it to be only displayed at certain pages.
This is only possible at the moment if you have the "Search facets" module installed and enabled. This will soon be switched to the Facet API-based facet solution (#1182614: Integrate with Facet API).
Interesting tool this "Facet block". It would be nice if the Facet API can integrate a bit more with Views:
- to respect format (e.g. grid, for multi-column facets styling)
- custom pager settings? with views ajax + small pager you have a perfect interface to drill down facets
If this is important to you, please open a new feature request. This is a support request, and probably already fixed.
However, as Views documentation was (at least last time I looked) severely lacking, such things are mostly harder to implement than they look.
Also, the way facets are retrieved, paging isn't natively possible. We would have to always retrieve all facets and then do manual paging in PHP code, which would be unnecessarily slow for the basic use case. It would therefore be important to consider how frequently paged facet blocks are needed (which I'd estimate to be quite rare).
If this is a requirement for one of your sites, you could still implement this as a local refinement quite easily, I guess.
Hi I was able to create a taxonomy facet block in views, yet the taxonomy name doesn't show but numbers -maybe taxonomy Ids?. How can I show the names?
"field_prof_group" being an exposed taxonomy field. The block displays fine but they link to a search without a keyword so it returns no result. How can i use those facets with an empty search?
If that does not work, what would be the use of those facet blocks?
it will give your display setting option then in [Home » Administration » Configuration » Search and metadata
Configure facet display for Intelligence]
in display settings >> displya widget change to link with checkboxes
Comments
Comment #1
drunken monkey- Create a view with a search index (e.g., "Default node index" – not "Search index") as the base table.
- Add a "Facets block" display.
- In the block settings, select the field to facet on (in your case, "Content type") and the path of the search you want to link to.
- Set up any additional filters you want on results. Fields and sorts don't have any effect, neither have exposed filters.
- Save the view, enable the block and set it to be only displayed at certain pages.
This is only possible at the moment if you have the "Search facets" module installed and enabled. This will soon be switched to the Facet API-based facet solution (#1182614: Integrate with Facet API).
Comment #2
Anonymous (not verified) commentedInteresting tool this "Facet block". It would be nice if the Facet API can integrate a bit more with Views:
- to respect format (e.g. grid, for multi-column facets styling)
- custom pager settings? with views ajax + small pager you have a perfect interface to drill down facets
Comment #3
drunken monkeyIf this is important to you, please open a new feature request. This is a support request, and probably already fixed.
However, as Views documentation was (at least last time I looked) severely lacking, such things are mostly harder to implement than they look.
Also, the way facets are retrieved, paging isn't natively possible. We would have to always retrieve all facets and then do manual paging in PHP code, which would be unnecessarily slow for the basic use case. It would therefore be important to consider how frequently paged facet blocks are needed (which I'd estimate to be quite rare).
If this is a requirement for one of your sites, you could still implement this as a local refinement quite easily, I guess.
Comment #4
BeaPower commentedHi I was able to create a taxonomy facet block in views, yet the taxonomy name doesn't show but numbers -maybe taxonomy Ids?. How can I show the names?
Comment #5
Anonymous (not verified) commentedI think you should open a new issue ;)
Comment #7
l0calh0rst commentedI would like to hook in here.
I have created such a block. The links look like this:
http://www.example.com/search?f[0]=field_prof_group%3A6467
"field_prof_group" being an exposed taxonomy field. The block displays fine but they link to a search without a keyword so it returns no result. How can i use those facets with an empty search?
If that does not work, what would be the use of those facet blocks?
Comment #8
l0calh0rst commentedNevermind, found the answer here: http://drupal.org/node/1368152#comment-5353080
Comment #9
user654 commented.
Comment #10
knalstaaf commentedFollowed the instructions, but I'd need checkboxes and links instead of just links. There's seems to be no other option in the block settings?
Edit: opened a separate issue for this: #2668398: Facets block (views) and checkboxes
Comment #11
hitech3273 commented@ knalstaaf ... follow as i said here ... your page where views displayed facet and your content then click on setting gear it will display
>>> Configure facet display
>>> Configure facet dependencies
>>> Configure facet filters
>>> Configure block
then click on configure facet display
it will give your display setting option then in [Home » Administration » Configuration » Search and metadata
Configure facet display for Intelligence]
in display settings >> displya widget change to link with checkboxes
then save and refresh page