I am using Drupal 8.7.5. I setup three different taxonomy types. They are Category, Types, and Tags. I have a custom post type called Products. I created a View called Products and added that as a page in my main menu. Then i used Devel to fill products with some dummy data. All of that went very smooth.

Now, I want to output all of the categories, types and tags in my page--products.html.twig file in a select menu or checkboxes to create a filter system.

I've been looking around and I don't see how to get to these values from a page template. Can anyone offer some clues?

  • You probably mean a faceted search, see drupal.org/project/facets – 4k4 Jul 31 '19 at 22:18
  • You could simply create Views blocks, one for each category, and place them on that page. – leymannx Aug 1 '19 at 6:52
  • I'll mess with that but I guess I was confused how to control the output so that I can show them as a select menu or check boxes. – Robbiegod Aug 1 '19 at 12:16
  • But this doesn't make a filter system, just demo elements without function. You should think about a Search API View and facets. – 4k4 Aug 1 '19 at 13:36
  • I want to use isotope.js to create a filter system. I just need to know how to output the categories, tags, and types from the database to construct the drop down menus. In wordpress, this is super easy to do. It is not so clear how to do this in Drupal and then be able to modify the structure of the html. I'll give the view a try and see what i can do. – Robbiegod Aug 1 '19 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.