0

We have a Documents bundle which is a list of documents, and an Accordeon which includes the previous one.

NODE_PAGE
|
|--- DOCUMENTS
|
|--- ACCORDEON
|    |
|    |--- DOCUMENTS

With this choice, I can attach documents directly to the node or to Accordeon sub-elements.

How can I list the most recent documents in a view? (I have to mix file_managed directly linked to the node and file_managed linked to the paragraph which is linked to the node.)

Is it possible from the view setting, or do I have to alter the query with hook_views_query_alter()?

  • I take you mean that the second content type has an entity reference field that references nodes of the first content type. In Drupal, a content type cannot contain another content type. – kiamlaluno Sep 18 '18 at 18:37
  • @kiamlaluno : I am using "paragraphs" so DOCUMENTS is a paragraph, and ACCORDEON is also one. And my problem is I don't know how to access to a paragraph that is in a paragraph using Views . – jteks Sep 19 '18 at 8:56
0

Finally I choose to create a View of type File and to alter data with the hook_views_pre_render(). I can now do queries and other custom treatments and set the results data of my view.

Your Answer

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

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