When a user's current listing is only showing 1 item, it doesn't seem to make sense to allow the user to attempt to further refine their search with terms attached to that item, because it will only ever show that item until the first term is removed.
For example, if taxonomy filter is in AND mode, and if a node is the only node tagged C, but node is also tagged with A and B, if C is selected in the current search, terms A and B show in 'refine search' as A[1] B[1], which can look a bit strange especially if the node is tagged with many other terms. It would seem better that in this case, and C is selected, the user should be advised to instead remove that term from their search before they can continue refining it.
The issue would also occur if taxonomy filter were set to only show terms with, for example, 2 nodes. If term C has two nodes and it is selected, the user would be able to continue refining to terms tagged in both those nodes, but get nowhere. A bit like being at the end of the road, but the taxonomy filter interface suggests you can still progress further.
Can anybody think of a solution to stop this happening?
Comments
Comment #1
Ela commentedsubscribing... would also like to know a solution for this.
Comment #2
lightsurge commentedEdit: function _taxonomy_filter_tids_upto might be a useful function to alter if we're using the basic 2 term refining, but not if we're using tf_multi
Comment #3
lightsurge commentedIs there a function better than 'taxonomy_select_nodes' that I could use to count the number of nodes with an array of attached terms?
I figure if we count the number of nodes attached to an array of terms, and if this equates to taxonomy filter's variable from 'display terms only if attached to X nodes' setting, then we can return NULL in above IF statement?
Therefore, if we've set this to 1, term C has 1 node but is also tagged with A and B, term C is selected, no refine links are displayed.
Comment #4
lightsurge commentedManaged to bend this to my will with a very rough hack. I'm using tf_multi/tf_count, so it turned out that the above wasn't relevant after all. I wanted to remove irrelevant refine links where 1) we're already at the minimum display of nodes 2) even if we're not at the minimum display of nodes, remove the refine links if they point to the same nodes. Below code is really unlikely to work for everyone, and obviously definitely not if they're not using tf_multi. I'm also only using the Cloud template so that might impact. Needs a lot of work if it's to become added if it even should be, obviously.
I added this function to get a count of nodes associated with an array of tids:
Called it just after the $block variable being established in taxonomy_filter_block_refine (taxonomy_filter.module), saving the result in $block['info']['urlcount']:
Then messed about with the sections of IFs in the tf_multi_tf_item_alter hook of tf_multi.module:
Comment #5
lightsurge commentedIs there any interest in adding something like this to the module in order to remove not-needed links from the filter?