Skip to main content
Ctrl+K
Logo image

Plone Training 2023

Trainings

  • Mastering Plone 6 development
    • 1. About Mastering Plone development
    • 2. Introduction
    • 3. The Case Study
    • 4. What is Plone?
    • 5. Installation
    • 6. The Features of Plone
    • 7. Configuring and Customizing Plone "Through The Web"
    • 8. Extending Plone with add-on packages
    • 9. Extending Plone
    • 10. Content types I
    • 11. Content types II: Talk
    • 12. Content types: Reference
    • 13. Customizing Volto Components
    • 14. Volto View Component: A Default View for a "Talk"
    • 15. Develop
    • 16. Behaviors
    • 17. Creating a dynamic frontpage with Volto blocks
    • 18. Programming Plone
    • 19. Turning Talks into Events
    • 20. Vocabularies, Registry-Settings and Control Panels
    • 21. Custom Search
    • 22. Testing in Plone
    • 23. Using Third-Party Behaviors
    • 24. Content types III: Sponsors
    • 25. Upgrade-steps
    • 26. The Sponsors Component
    • 27. Using Volto add-ons
    • 28. Extending Volto with a custom add-on package
    • 29. Extending Volto With a FAQ Block Type
    • 30. Workflow, Roles and Permissions
    • 31. Relations
    • 32. Roundtrip [The voting story] frontend, backend, and REST
      • 32.1. Complex Behaviors [voting story]
      • 32.2. REST API endpoints [voting story]
      • 32.3. Volto Actions and Component State [voting story]
      • 32.4. Permissions [voting story]
    • 33. Releasing your code
    • 34. The code for the training
    • 35. Trainer: Preparation
  • Mastering Plone 5 development
    • 1. About Mastering Plone
    • 2. Introduction
    • 3. What is Plone?
    • 4. Installation & Setup
    • 5. The Case Study
    • 6. The Features of Plone
    • 7. The Anatomy of Plone
    • 8. What's New in Plone 5, 5.1 and Plone 5.2
    • 9. Configuring and Customizing Plone "Through The Web"
    • 10. Theming
    • 11. Extending Plone
    • 12. Extend Plone With Add-On Packages
    • 13. Dexterity I: "Through The Web"
    • 14. Buildout I
    • 15. Write Your Own Add-Ons to Customize Plone
    • 16. Return to Dexterity: Moving contenttypes into Code
    • 17. Views I
    • 18. Page Templates
    • 19. Customizing Existing Templates
    • 20. Views II: A Default View for "Talk"
    • 21. Views III: A Talk List
    • 22. Testing in Plone
    • 23. Behaviors
    • 24. Writing Viewlets
    • 25. Programming Plone
    • 26. IDEs and Editors
    • 27. Dexterity Types II: Growing Up
    • 28. Custom Search
    • 29. Turning Talks into Events
    • 30. User Generated Content
    • 31. Resources
    • 32. Using Third-Party Behaviors
    • 33. Dexterity Types III: Python
    • 34. Dexterity: Reference
    • 35. Relations
    • 36. Manage Settings with Registry, Control Panels and Vocabularies
    • 37. Creating a Dynamic Front Page
    • 38. Creating Reusable Packages
    • 39. More Complex Behaviors
    • 40. A Viewlet for the Votable Behavior
    • 41. Making Our Package Reusable
    • 42. Using starzel.votable_behavior in ploneconf.site
    • 43. Releasing Your Code
    • 44. Buildout II: Getting Ready for Deployment
    • 45. Plone REST API
    • 46. The Future of Plone
    • 47. Optional
    • 48. Using the code for the training
  • Volto Hands-On
    • 1. Introduction
    • 2. Quick Start
    • 3. Project requirements
    • 4. Theming
    • 5. Header
    • 6. Breadcrumbs
    • 7. Footer
    • 8. Edit config and site cleanup
    • 9. Brief introduction to Volto blocks
    • 10. Blocks - Highlight Block
    • 11. Configurable Downloadlink Block
    • 12. Events listing template
    • 13. Sprint content type
  • Volto Add-ons Development
    • 1. Introduction
    • 2. Volto add-ons development
    • 3. Basic working block
    • 4. Improve the block view
    • 5. Block editing with a form
    • 6. Customizable columns
    • 7. Make the block extensible
    • 8. Add-ons - advanced topics
    • 9. Plone integration with Volto blocks
    • 10. About
    • 11. Developer integration with text editors
    • 12. Really short primer on Javascript enhancements
  • Effective Volto
    • About Effective Volto
    • Getting Started
      • 1. Bootstrapping a full Plone 6 project
      • 2. Bootstrapping an Add-on
      • 3. Developer roadmap
    • Architecture
      • 1. Volto Client - Server duality
      • 2. Razzle
      • 3. Webpack
      • 4. Babel
      • 5. Webpack loaders
      • 6. Bootstrap Volto
      • 7. Inside Volto
      • 8. Volto Blocks
      • 9. Configuration Registry
      • 10. Redux
      • 11. CORS
      • 12. Multilingual
    • Backend
      • 1. Plone REST API endpoints
      • 2. Writing an endpoint
      • 3. Writing a serializer or a deserializer
      • 4. Writing a content expansion endpoint
      • 5. Writing a block transform
      • 6. Block field contribute to searchableText
      • 7. Link integrity for blocks
      • 8. Writing Express middleware
    • Add-ons
      • 1. What is a Volto add-on
      • 2. Bootstrap an add-on
      • 3. How does a Volto add-on works?
      • 4. Configure a released Volto Add-on in your project
      • 5. Configure an unreleased add-on from an existing repository
      • 6. Volto views
      • 7. Create a block using BlockDataForm
      • 8. Blocks Layout
      • 9. Block Extensions
      • 10. Block Styling
      • 11. Add-on dependencies
      • 12. Add-on and project configuration pipeline
      • 13. Create a theme add-on
      • 14. Extending Semantic UI
      • 15. Create a custom Listing block variation
      • 16. Integrate with Volto’s asyncConnect for SSR
      • 17. Add-on Internationalization
      • 18. Extend Webpack setup from an add-on with razzle.extend.js
    • Testing
      • 1. Acceptance testing
      • 2. Jest
      • 3. Unit testing
      • 4. Storybook
      • 5. Testing add-ons
    • Deployment
      • 1. Seamless mode
      • 3. Simple deployment
      • 4. Docker
      • 5. release-it
    • Development tools
      • 1. How to setup your development environment using environment variables
      • 2. Environment variables
      • 3. Icons
      • 4. Husky and lint-staged
      • 5. Shortcuts
      • 6. Internationalization
      • 7. Lazyloading components, injectLazyLibs for libraries
      • 8. critical.css
      • 9. Bundle analyzing
      • 10. Component Registry
      • 11. Linters
      • 12. Debugging with Volto
      • 13. VSCode extensions/helpers
      • 14. vim and neovim integration
  • Testing Plone
    • Summary
    • Intro to tests
    • Some theory
    • How to test a Plone add-on
    • Testing setup
    • Unit tests
    • Testing a Dexterity content type
    • Testing a view
    • Acceptance testing
    • Robot tests
    • Continuous Integration
  • Plone 6 Classic UI Theming
    • 1. Preparation for the theming training
    • 2. TTW Customizations
    • 3. Create a theme based on Barceloneta
    • 4. Create a Theme from scratch
    • 5. Create a theme based on Diazo
  • Plone Deployment
    • Introduction
    • Training setup
    • Introduction to Plone stack
    • Plone Docker Images
    • Create a Project
    • Editing your project
    • Server Setup
    • Deploy
  • Plone Workflow
    • Introduction To Workflows
    • Basic Roles and Permissions
    • Local Roles
    • Dynamic Roles
    • Placeful Workflow
    • Multi-chain Workflows
    • Workflow Variables
    • Using GenericSetup to Manage Plone Workflows
  • Migration best practices
    • Migrating Plone
    • In-place migrations
    • Migrating with collective.exportimport
    • Migrate to Volto
    • Migrating from third party systems to Plone

Info

  • Glossary
  • Contributing to Plone Training
    • Building and Checking the Quality of Documentation
    • General Guide to Writing Documentation
    • Authors Guide
  • Teaching
    • 1. Training theory: education, how people learn and process information
    • 2. Before the training: Create material, invite trainees, preparation
    • 3. During training day(s): what to expect, do's and don'ts
    • 4. After the training: Aftercare, keep in touch, learn, improve
21. Custom Search – Mastering Plone 6 development
  • Repository
  • Suggest edit
  • Open issue
  • .md

Custom Search

Contents

  • 21.1. Exercise

21. Custom Search#

Volto has a search block that allows you to build custom searches without additional addons.

21.1. Exercise#

Show talks on the talks page with a search block. The visitor should see a filter for the type of talk (Keynote, Talk, Lightning Talk).

You can add facets in the sidebar, but "type of talk" is not available. What is necessary to implement?

Remember what we did to show featured content on the front page.

Tips for a Solution
  • The field type_of_talk needs to be indexed in catalog.

  • type_of_talk needs to be a collection criterion.

After adding an index and a criterion, and restarting the backend, and re-installing the add-on, the index is present in catalog but empty.

For populating the index you can go to http://localhost:8080/Plone/portal_catalog/manage_catalogIndexes and reindex the new index.

In case you want to change something of the index, the index can be deleted. A re-start of the backend, a re-install of the add-on and a new re-index of the index will populate the index.

Check the entries by switching to "Browse" button.

Solution

catalog.xml

  <index name="type_of_talk" meta_type="KeywordIndex">
    <indexed_attr value="type_of_talk"/>
  </index>
  <column value="type_of_talk"/>

querystring.xml

  <records interface="plone.app.querystring.interfaces.IQueryField"
           prefix="plone.app.querystring.field.type_of_talk">
      <value key="title" i18n:translate="">Type of Talk</value>
      <value key="enabled">True</value>
      <value key="sortable">False</value>
      <value key="operations">
        <element>plone.app.querystring.operation.selection.any</element>
        <element>plone.app.querystring.operation.selection.all</element>
        <element>plone.app.querystring.operation.selection.none</element>
      </value>
     <value key="group" i18n:translate="">Metadata</value>
     <value key="vocabulary">ploneconf.types_of_talk</value>
  </records>

previous

20. Vocabularies, Registry-Settings and Control Panels

next

22. Testing in Plone

Contents
  • 21.1. Exercise

By Plone Community

© Copyright The text and illustrations in this website are licensed by the Plone Foundation under a Creative Commons Attribution 4.0 International license.