Search code examples
plonefaceted-search

EEA Faceted Navigation : how to override the description?


I have registered a custom view for the faceted navigation, but I want to override the description slot.

In the body I have :

<metal:content-description fill-slot="content-description">
    <metal:block define-macro="content-description">
        My custom Description
    </metal:block>
</metal:content-description>

<metal:content-core fill-slot="content-core">
    <metal:block define-macro="content-core">
        ...

But this doesn't work, I've got the legacy description instead... The content-part is working.

Is there is something am I missing ?


Solution

  • It's not in the custom faceted preview template that you have to add the description.

    You have to override the eea.facetednavigation.browser.template.view.pt and add your description.

    <tal:left define="hidden python:request.set('disable_plone.leftcolumn', view.hide_left_column)" />
    <tal:right define="hidden python:request.set('disable_plone.rightcolumn', view.hide_right_column)" />
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
        lang="en-US"
        metal:use-macro="here/main_template/macros/master"
        i18n:domain="eea">
    
    <metal:jsslot fill-slot="javascript_head_slot">
      <script type="text/javascript"
         tal:content="string:jQuery(document).ready(function(evt){
           Faceted.Load(evt, '${context/absolute_url}/');
         });"></script>
      <script type="text/javascript"
        tal:content="string:jQuery(window).unload(function(){
            Faceted.Unload();
        });"></script>
    </metal:jsslot>
    
    <body>
    
    <metal:content-description fill-slot="content-description">
        <metal:block define-macro="content-description">
            <div class="documentDescription" tal:condition="context/rich_description">
                <tal:r tal:replace="structure context/rich_description">Description</tal:r>
            </div>
        </metal:block>
    </metal:content-description>
    
    <div metal:fill-slot="content-core">
    
    <!-- Folder contents -->
    <div class="faceted-form" metal:define-macro="widgets" id="faceted-form"
      tal:define="mode view/mode | string:view" tal:attributes="data-mode mode">
    
      <!-- Basic/Extended search -->
      <div class="faceted-sections-buttons">
        <a href="#" class="faceted-sections-buttons-more" i18n:translate="">More filters</a>
        <a href="#" class="faceted-sections-buttons-less" i18n:translate="">Less filters</a>
      </div>
    
      <metal:widgets use-macro="here/@@faceted_widgets/macros/widgets" />
    
      <!-- Faceted version -->
      <div style="display: none" id="faceted-version"
        tal:content="here/@@faceted_version|string:" />
      </div>
    
    </div>
    </body>
    </html>