Skip to content

Commit

Permalink
Customized facets view.
Browse files Browse the repository at this point in the history
  • Loading branch information
buchi committed Mar 7, 2012
1 parent 10a8f65 commit 8039180
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ftw/solr/browser/configure.zcml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
layer="ftw.solr.interfaces.IFtwSolrLayer" layer="ftw.solr.interfaces.IFtwSolrLayer"
/> />


<browser:page
for="OFS.interfaces.IFolder"
name="search-facets"
template="facets.pt"
class="collective.solr.browser.facets.SearchFacetsView"
permission="zope2.View"
layer="ftw.solr.interfaces.IFtwSolrLayer" />

<browser:page <browser:page
for="*" for="*"
name="querycatalog" name="querycatalog"
Expand Down
40 changes: 40 additions & 0 deletions ftw/solr/browser/facets.pt
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,40 @@
<div id="portal-searchfacets"
tal:define="facets view/facets; selected view/selected"
tal:condition="python: facets or selected"
i18n:domain="solr">

<h4 i18n:translate="heading_search_facets">
Filter
</h4>

<ul id="selected-facets">
<li tal:repeat="item selected">
<span class="facetItemTitle"
tal:content="item/title"
i18n:translate="" />:
<span class="facetItemValue"
tal:content="item/value" />
<a class="facetRemoveItem"
tal:attributes="href string:${request/ACTUAL_URL}?${item/query}"
title="Remove this search limit..." i18n:attributes="title" >
&otimes;
</a>
</li>
</ul>

<dl id="available-facets">
<tal:facets repeat="facet facets">
<dt tal:content="facet/title" i18n:translate="" />
<dd>
<ul>
<li tal:repeat="item facet/counts">
<a href="#" tal:content="item/title"
tal:attributes="href string:${request/ACTUAL_URL}?${item/query}" />
<span class="facetItemCount">(<span tal:replace="item/count" />)</span>
</li>
</ul>
</dd>
</tal:facets>
</dl>

</div>

0 comments on commit 8039180

Please sign in to comment.