Active
Project:
Facet API
Version:
7.x-2.x-dev
Component:
Usability
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Jan 2012 at 05:08 UTC
Updated:
15 Feb 2021 at 16:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
cpliakas commentedThis is a great use case for the realm system and is how this functionality could be accomplished. Currently the only "realm" available is the block realm, but you could define a "second_block" realm that would allow for a duplicate set of blocks for the same facet that could each have different widgets. I am not sure how flexible the API is in that you would probably have to replicate a lot of the functionality in the facetapi.block.inc file, but I will poke around and see if there are any cleanup tasks that would facilitate building a contrib to more easily satisfy this use case without the need for code.
Showt answer, the architecture definitely supports this although it would take some custom coding that might be a bit of a PITA because of the code duplication.
Thanks for posting,
Chris
Comment #2
in a nutshell commentedThanks for replying , But why doesn't configuration form give multiselect list for widgets and the function of
facetapi_facet_display_form_submit saves as much facet objects as we choose in many facetapi database table raws and each configuration name which is unique should contain the widget name also the block name should? I mean i think it would be more simple way . Ty again for this great module
Comment #3
cpliakas commentedOne of the reasons is that the user might not want to inherit the display settings of the other, for example it might make more sense to sort them differently or allow them to configure empty behavior plugins. They really should be two separate configurations, but I understand the point you are making and think that the current architecture would allow for too much duplication using the system proposed in #1.
The more I think about it the more I like this approach. From a UI standpoint, I am thinking that when you visit the facet page you have a blank slate as opposed to a list of facets you can either enable or not. To add a facet you would click on the "Add Facet Block" link which would popup a modal and allow you to add whatever facets you want. Therefore you could add the same facet multiple times.
The UI challenges I see are forcing a user to enter a machine name for the facets they select as well as where to place the links for the global configurations. Let's say you have the author facet displayed in three different ways. When you click on one's "configure dependencies" link, then it isn't transparent that that would effect the others as well.
There are a lot of little things to think of before a change like this takes place. Let me know your thoughts.
Thanks,
Chris
Comment #4
cpliakas commentedChanging to a feature request, punting to the 7.x-2.x version for future consideration.
Comment #5
attiks commentedI have another use case: it want to display my facets depending on the screen size of the browser, if I could 'duplicate' the facet blocks i could use context + mobile tools to show/hide the facets.
Comment #6
cpliakas commentedGreat use case! Didn't think of that.
Comment #7
drunken monkeyI'm definitely also interested in this, thanks already for the tip in #1! A system where you could just have more than one block for a single facet would of course be better, though.
As already stated in the Search API Facet API integration issue (or the sandbox issue queue, don't know), the previous Search API Facets module was able to do that. As a UI, it provided just a "clone" link next to all facets, enabling you to create more blocks for a facet. That would maybe be an alternative, although your suggestion in #3 also sounds pretty good, and would also have the potential to make the facet list much clearer, by just displaying the facets you are interested in.
PS: Has maybe anyone got some code for this workaround already, in a sandbox or the like?
Comment #8
batje commentedI got code that works, going to sandbox it in the coming days.
Its a separate module that allows you to create additional realms as entities.
If we would like to change the way in which facets are added to a realm, that is a different (i guess this) issue, which is managed by facetapi.
My current code does support 1 hardcoded additional realm and everything works with that. In theory, my facetapi_realms module can take over the current 'block' realm as well (the module could create that by default upon installation)
will ping here when its sandboxed.
Comment #9
batje commentedWe have to stall working on this for a few weeks, so I created the sandbox. There is 1 hardcoded additional realm in the module called Graphs.
http://drupal.org/sandbox/batje/1570344
Comment #10
cpliakas commentedThanks for sharing, batje!
Overall I think this is the right approach. I think there are some API functions that could either be leveraged or modified to promote code reuse, but I think this is an excellent start.
Thanks for sharing!
Chris
Comment #11
drunken monkeyThanks a lot for posting this, this is exactly what I need! Nice work!
Comment #12
batje commented@cpliakas the fact i copied a complete file and modified only 1 function in it surely indicates something is wrong. I think once my module is done, it could be a submodule of facetapi that manages the realms.
The only reason not to do that, would be if there is a case for other than 'block' based facets. I am not sure if there is, though we are ourselves thinking about putting facets on a map as an openlayers layer. That could turn into a completely new type of realm. not sure yet.
Comment #13
cpliakas commentedbatje,
Thanks. I think my goal is for the block realm code in Facet API to be flexible enough so that your module can reuse the functions. For example, the logic in the facetapi_block_info() implementation should be abstracted out into an API function where you can pass something other than "block", like in your case ''graphs", to be able to reuse code. Most of this issue lies within Facet API, and I am definitely willing to work with you to resolve the problems.
Regarding non-block facets, please do so!! Search Lucene API (which is effectively where Facet API came from) had non-block facet realms. They were simply never ported over to this module because of time. I woud love to have non-block facets as I think they have the opportunity for some exciting new user experiences, and I would love for people like you to pioneer this. Lot's of really cool possibilities.
Thanks again for your work on this,
Chris
Comment #14
cpliakas commentedPosted related issue against Facet API at #1663168: Improve the flexibility of the block generation code so other modules can reuse it for different realms.
Comment #15
cpliakas commentedPosted corresponding issue against Facet API Realms at #1663276: Leverage recent Facet API block code changes to greatly reduce the amount of code.
Comment #16
batje commentedWe plan to work on this next week. Thanks for the heads up
Comment #17
theluu commentedComment #18
darksnowHi,
What is the status of this work?
I'm looking to filter on a date field in two ways. Once using a date_range query type allowing me to use named ranges using the date_facets module, and I would like another block to accept a date query type so I can limit to a specific date on the same indexed field.
I think the discussion about additonal realms above isn't quite what I'm looking for and wondered if anyone has any ideas?
Thanks.
Martin...
Comment #19
Tharick commentedThanks for sharing this man @batje. It works well.
By the way, its shows the additional block in the same view page in different region. I want, two separate blocks to display both front page as well as products page.
Is it possible in any other way, please help me out.
Thanks in advance.
Comment #20
efpapado commentedAny news here?
Comment #21
mitchelljj commentedThanks for sharing this man @batje. It works well for me also!!!!!!
John
Comment #22
bisonbleu commentedNice! Deluxe Royal... Thanks @batje
Comment #23
ytsurkIncredible, 8 yr old sandbox code is still working and very useful !
Thx.