Content List Filter

In order to add the Content List Filter Block, you should use this block class:

\Blackbird\ContentManager\Block\Filter

This Block need an argument ‘filters’ which are the attributes you filter the content list on. These attributes must be type of select (checkbox, radio, select, multiselect).

How to add this block to my content list?

We want to add a sidebar filter on the left of the Content List of a specific ContentType:

You should add this piece of code on a layout update xml field, or in a layout xml file.

  <referenceContainer name="sidebar.additional">
   <block class="Blackbird\ContentManager\Block\Filter" name="contenttype_identifier-sidebar-navigation-filter">
   <action method="setFilters">
   <argument name="filters" xsi:type="array">
   <item name="1" xsi:type="string">customfield_identifier_1item>
   <item name="2" xsi:type="string">customfield_identifier_2item>
   argument>
   action>
   <action method="setCtType">
   <argument name="type" xsi:type="string">contenttype_identifierargument>
   action>
   block>
   referenceContainer>
loader
Loading...