Add a Search block – Content Editing for Plone

Add a Search block

Add a Search block#

A search block allows you to set up a custom search within your site for a specific section.

In this example, we'll create a page containing a search block.

  1. Click the Add button Add document icon to add a search block.

  2. Click Page

  3. Click "Type the title...".

    Type "My page" as the title.

  4. Click the on the Add block button Add block icon to add a search block.

  5. Add a search block.

  6. Click the Headline field to set the display name of the search block.

    Type "Site search" as the block headline.

  7. Click Add criteria.

  8. Click Type to specify the content type of items we want to search for.

  9. Click Select to display the content types to choose from.

  10. Click Page.

  11. Click Sort on to set the sort order.

  12. Click Modification date to sort by.

  13. Click Reversed order to display the most recently modified items at the top of the listing block.

  14. Click the Item batch size field to set how many items should be shown per batch.

    If there are more than this number of items to show, the block will show "Next page" and "Previous Page" buttons at the bottom of the block.

    In this example, we do not set the Results limit, which is the maximum number of items to display.

    Type 10 as the batch size.

  15. Click on the Results template select menu to you choose how to display the listed items.

  16. Click on Grid to select the grid results template.

  17. Facets are filters you can add to your search block to help a user refine their search.

    Click on Add Facet to add a facet.

    A search block can contain multiple facets for the user to filter their search.

  18. Click the Label field to add a label to each facet.

    Type "Tags" as you'll be adding a facet to filter by tag.

  19. Click on Field to see the options available.

  20. Click on Tag.

  21. Click on Facet widget to pick which type of widget you want to use for this facet.

  22. Select Checkbox to display a list of available Tags as checkboxes.

  23. Click on Add Facet to add another facet.

  24. Click the Label field to add a label to each facet.

    Type "Date range" as you'll be adding a facet to filter by tag.

  25. Click on Field to see the options available.

  26. Click Modification date.

  27. Click on Facet widget to pick which type of widget you want to use for this facet.

  28. Select Date Range to display date picker widgets for a modification date range.

  29. Click on Sort on options.

    This adds a widget with options for the user to sort their search.

  30. Click "Creation date" and "Effective date" to add them to the list of options to sort by.

  31. Click the Save button to save your page.

  32. The Search field will allow the user to search with a text search.

    The facets will narrow that search down.

  33. The Tags facet will allow the user to select items that are tagged and filter according to that tag.

  34. The Date range facet will allow the user to narrow down their search inside of a specific date range.

  35. If there are no results in the date range selected, they can clear the range by clicking the Clear button Clear icon.

  36. Click on the sorting drop-down to sort the search according to a selected date type.