2

Standard drupal field types like Strings, Numbers, Dates and Taxonomies can be defined as Sortable in Views with Format: Table.

But more complex fields like Hierachical Taxonomies and Paragraphs or paragraphs don't have a checkbox to make them Sortable.

Is there any way to make them sortable using Views interface or do I have to make a custom plugin Tablesort with EntityQuery?

1 Answer 1

4

Categories or Paragraphs are just references when you create a node view. Thus when you use them in the fields (as output) they are not sortable but you can add a relationship to them and then their individual fields (like name, id etc) become sortable

Here is an example with tags (on article content type)

Added term relationship Taxonomy terms on node and then tag id and tag name are sortable (among others)

enter image description here

enter image description here

ΝΟΤΕ: you will most certainly end up with duplicate results in the view. For this you can use aggregation, "Group results together" with group column "entity id".

1
  • Thanks, that works out great for Taxonomy terms and also for Paragraphs. But I can't figure out how to make a reference to the second value of a multiple values field. I can't find a delta anywhere, any hint for that?
    – geraldo
    Jan 20, 2019 at 21:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.