Closed cspurk closed 12 years ago
Point 1 should be fixed now.
Point 2 fixed too, with pull request #83
@olihamon I’m not very happy with the fix for point 2. Although the solution appears to work, it is somehow awkward: the facets are all rendered twice into the resulting HTML, however, only half of them are hard coded with CSS to either be visible or not. Brrr … Aside from elegancy concerns, I don’t know what a screen reader for blind people would do with this HTML code.
The underlying problem seems to be that a good solution for point 2 needs more logic than is easily feasible with the Django template language. This is actually a sign that the logic should rather be moved to Python code (cf. KISS principle for templates). In the concrete case we might need extra context for the template which contains information about whether a facet is currently being used or not; although this information is somehow already encoded in the request, it is not easily accessible using the Django template language.
So, an attempt to better solve point 2 might be to override the extra_context
method of SearchView
in our MetashareFacetedSearchView
class and add a new entry selected_facets
there which contains one entry per facet with one or more facet items.
Aside from all this, there still appears to be a bug in the implementation. Although the multilinguality type is used as a facet in the following example, it appears after the linguality type facet which is not used: http://localhost:8000/repo2/search2/?q=&selected_facets=multilingualityTypeFilter_exact%3Acomparable
Two related suggestions for improvement: