Closed (duplicate)
Project:
Facetapi Select
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Oct 2013 at 08:14 UTC
Updated:
13 Oct 2015 at 16:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
30equals commentedI added a patch which basicly swithces the key and values of the options array when the facet is active. There's probably a more elegant way to do this. But now because i switch keys and values and reverse the array, the default is not actually been forced, but falls back to the first option still, but that's the option of the chosen facet now. so you need to select the default first label to reset it.
Hope this makes sense.
Comment #2
finex commentedMaybe if a value is selected, the label "--Choose--" should be changed to something like "--View All--". This could help the user to understand the UI. What do you think?
Comment #3
rp7 commentedAttached patch is another way to do it.
Comment #4
rp7 commentedComment #5
Exploratus commentedTried #4, got
Notice: Undefined index: default_value in facetapi_select_facet_form() (line 10 of /******/facetapi_select/facetapi_select.module).
Notice: Undefined index: default_value in facetapi_select_facet_form() (line 11 of /******/facetapi_select/facetapi_select.module).
Comment #6
Exploratus commentedAlso, when I go back to no selection, it sends me to the homepage...
Comment #7
Exploratus commentedApplied #1 and that worked beautifully. Also changed the text from Choose to view all as suggested by #2. Works perfectly! Thanks!
Comment #8
jody lynnDuplicate of #1412442: Selected value ?
Comment #9
jody lynnI think the approach in comment 4 is cleaner, but it needs work to resolve the issues in comments 5 (easy) and 6.
Comment #10
jody lynnComment #11
khiminrm commentedHi, everyone! I've found this issue and want to share my idea. In one of my projects I need this feature https://drupal.org/node/2284099 and also to show default element for reseting facets. I've written the code in case when facetapi_pretty_paths installed.
Comment #12
khiminrm commentedI think my patch from #11 is usefull after applying patch from issue https://drupal.org/node/2283201, when active element is shown.
Comment #13
alcroito commentedHi.
I'm attaching a patch that rewrites the code pretty heavily to allow:
- Customizable reset label with a reset link for the current facet only
- Option to pre-select active facet. (this was inspired and incorporated from https://drupal.org/node/2283201 , thanks mparker17)
In conjunction with the facet api patch here https://drupal.org/node/1393928 , you can create for example 3 select field facets, you can only choose one value from each, and easily reset one of the values chosen.
Comment #14
alcroito commentedComment #15
mparker17@Placinta's patch in #13 includes the functionality of #2283201: Provide an option to pre-select the active facet, which I've closed as a duplicate of this patch.
Comment #16
mparker17The patch works great for me.
The code looks good, except for two coding-standards problems:
Always use a space between the dot and the concatenated parts to improve readability.
All comments should wrap at 80 characters.
... once these have been fixed, I'd say the patch in #13 is RTBC!
Comment #17
alcroito commentedInstalled coder module, and fixed all the warnings that it gave me.
Attaching updated patch and inter diff.
Comment #18
mparker17Looks good to me! @Placinta, thanks for all your help and hard work!
Comment #19
ssoulless commentedit works!
Comment #20
alcroito commentedAttaching an updated patch and interdiff, which adds the #states FAPI key, to make the Facet API select settings appear only when it is the active widget chosen. Without this change, if any other widget was selected as active, the Facet API select settings were still shown.
Comment #21
ssoulless commentedComment #22
rooby commentedIs this related to #2336857: Unable to de-select a value?
Possible duplicate?
I'm going based on just the original post of both issues so I could be way off.
Comment #23
pamelad commentedThe patch in #20 works for me, and the change makes sense.
Comment #24
sagesolutions commentedThe patch #20 also worked for me! Thanks a bunch!
Comment #25
dagomar commentedThis does not work as I would expect.
When the facet is not active I have an 'Display all' option (which I added under Default Option Label)
When I choose a facet the 'Display all' is missing. Is my configuration amiss?
Comment #26
dagomar commentedOk - I got it working with some additional configuration. Apparently you have to choose OR for this to work. I didn't want that, I want that it just displays the one that you chose, I think it should work that way, but now the options get filtered out.
EDIT
Oh my gosh how confusing. I think I got it working the way I want it, by selecting OR but 'Limit to one active item' checked. Not sure if this patch should take into account different ways of enabling this option.
Comment #27
grndlvl commentedRe-roll against 7.x-1.x.
Still testing and going over logic before committing.
Comment #28
thierrydallacroce#27 failed to patch on 2 out of 3 hunks, so attempting to remedy to it with the attached patch #28. Let me know if that applies and works as intended.
Comment #29
thierrydallacroce#29 replaces #28 by addressing a coding standard issue on one line.
Comment #30
dagomar commentedPatch #29 works for me.
Comment #31
grndlvl commentedI realized a lot of work has happened here, but I believe another ticket that resolves this better, which also has had a lot of work, resolves this issue nicely. #2336857: Unable to de-select a value
With that I am actually going to mark this one as a dupe.