0

In Drupal 7, given a custom paragraph bundle and an associated template file, is there a way to list all the nodes using that bundle? Or, if it's any easier, a way to do the same for a specific module instead of a paragraph type?

A Drupal core module update (https://www.drupal.org/project/link/issues/3095484) broke a bunch of our links across our site, and while a workaround is available, I wanted to test it against all the existing nodes first.

  • Welcome to Drupal Answers! :-) What have you tried so far? Entity field query? Do you know how to write a custom module? Please edit your question and add your current approach or code that is not working. Many thanks – leymannx Jan 11 at 16:47
  • Is there a reason why you can't create a view? – runswithscissors Jan 11 at 20:21
0

As @runwithscissors stated in the comments, you can use views to to this.

I’m not super experienced with views in Drupal 7, but It should be as easy as:

  1. Create a view that lists the nodes .
  2. Add a relationship to the referenced paragraphs.
  3. Add a filter on the paragraphs bundle.

That should be all. Once you have added the relationship, the bundle field will be made available as a filter.

I hope this is as easy in Drupal 7 as it is in Drupal 8.

You can read more about views here.

|improve this answer|||||
  • Thanks for your help! I realized I was mistaken in my original question... what was needed was a way to list all instances of a certain field type (link), rather than nodes and paragraphs. That was my bad, and I will start another question for that. Thank you! – arcataroger Jan 14 at 21:51

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.