Closed (fixed)
Project:
Simple hierarchical select
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2013 at 20:55 UTC
Updated:
19 Jan 2018 at 19:40 UTC
Jump to comment: Most recent
Comments
Comment #1
stborchertI've committed a change to shs to allow altering a) the callbacks used to get the data with JSON and b) the list of terms retrieved by shs.
$alter_optionsis an associative array containing vid, parent and settings from functionshs_term_get_children().Comment #2
manasiv commentedYour change is working just fine. I am still to test this for a site with high number of categories. I will check for any performance issues and reply back.
Thanks !
Comment #3
stborchertHi.
I guess you didn't find any further issues with this new functionality so setting this to "fixed" ;)
Comment #5
manasiv commentedYes, this works just fine for ~1000 category tree :) I was able to implement this hook in the site's custom module and conditionally filter the list of categories.
Comment #6
prash1485 commentedThis is exactly I was looking for. I am not really good with programming.
Can someone please help me how can I use this hook to hide(alter) empty categories on exposed filter which do not have any nodes associated with them.
Thanks in davance
Comment #7
manasiv commentedHi prash1485,
You can use this as an example. Following code goes in mymodue.module file.
Comment #8
nikolino commentedI've the same problem... where I have to put this code? in shs.module? which line?
Thank you!
Comment #9
stborchertYou'll have to add the code to a custom module and rename the function according to your module's name ...
Comment #10
nastassia commentedTo save the next person a couple of minutes, here is a link to a tiny custom module I made.
In my case, all content is always published. So I only needed to check if a taxonomy term has associated content. And the method suggested by manasiv (#7) became:
Thanks!
Comment #11
mandus.cz commenteddoes not work in 7.x-1.7