Permalink
Browse files

Customized facets view.

  • Loading branch information...
1 parent 10a8f65 commit 80391806d797f28175368ad4b0cfb011907a2c35 @buchi buchi committed Mar 7, 2012
Showing with 48 additions and 0 deletions.
  1. +8 −0 ftw/solr/browser/configure.zcml
  2. +40 −0 ftw/solr/browser/facets.pt
@@ -12,6 +12,14 @@
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
for="*"
name="querycatalog"
View
@@ -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.