1

I have a content type with a field of type paragraphs, with possible unlimited values. I need to show the total number of paragraphs for every node, in a column, in a views (table of fields). It seems to be only possible to render a preview of the paragraph. I tried to use "rewrite result" with "replacement patterns" but the only token available are the following:

{{ field_hours }} == Hours
{{ field_hours__target_id }} == Raw target_id
{{ field_hours__target_revision_id }} == Raw target_revision_id

How I can proceed?

1 Answer 1

1

I managed to achieve this doing the following:

  • Create a View to show Content of Type All. Add a page as well if you wish.
  • Format the style to be a Table.
  • Go to Advanced and turn on "Use aggregation".
  • Go to aggregation settings for the field "Content:Title" and set the aggregation type to "Count".
  • Change the label of this field to something like "Number of paragraphs in the node:".(*optional)
  • In Fields add field "Content:Title", aggregation type should be Group results together.
  • Add Filter Criteria "Hours (field_hours:target_id)", aggregation type should be Group results together, and set the operator to "is not empty(NOT NULL)".

This is how the Display settings should look at the end: Display settings

And here are the desired results in the preview:

Preview mode

I hope this helps.

1
  • Thanks for your time Emily, this worked well
    – Vasily
    Commented Mar 1, 2019 at 18:41

Your Answer

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

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