General

  eZ Systems Website
  Technical documentation
  Editor documentation

This Documentation contains:
 
Technical documentation:



⚠ WARNING ! This documentation is deprecated !

Please go to the current Technical Documentation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: cosmetic changes

...

This step is very similar to the previous one on adding the pagination. We are going to add a new type parameter in the whole component stack; the main difference with the offset case is that the user will pick a Content Type in a drop-down list instead of just using the Next/Previous links in the page.

...

Of course, the end user is not supposed to tweak the URI to filter by Content Type. To provide a usable interface, we will add a a drop-down list where he they can choose a Content Type to only get the corresponding list. Again, this is done server side by modifying the Controller to fetch the list of Content Types and Content Type Groups with the Content Type Service. Once this is done, the types and the groups can be passed to the Twig template to build a drop-down list in the following way:

...

The only remaining feature is now to take into account the user interaction on the added drop-down list. The view is responsible for that and it will basically subscribe to the change DOM event on the list and will fire the the  navigateTo event like we did in the offset case:

...

Basically, when the user selects a value in the drop-down list, the view fires the navigateTo event to navigate to the eZConfListOffsetTypeIdentifier route with the corresponding Content Type identifier and the offset set to 0. The view service is still handling this event and takes the user to the corresponding page in the application.

Tip
titleResults

And that's it! We now have a working interface to navigate through Content with a flat list that can be filtered by Content Type. The resulting code can be seen in the 8_filter tag on GitHub, this step result can also be viewed as a diff between tags 7_pagination and 8_filter. The conclusion page lists the potential improvement and some bugs in our current implementation. It also gives a list of documentation pages to read to go into deeper detailsmore detail.