Embedding Drupal 7 Views with the Paragraphs module

January 21, 2017


The Paragraphs module has been super helpful to developers and site builders who want to provide content editors with a solution to create amazing looking sites without having to know HTML.

I'm currently using Panels/Panelizer and Fieldable Panels Panes in the Drupal build at work to allow content editors to create the pages they want. Panels overall is great but I've come across situations where the In-Place Editor is buggy and/or creates confusion for users. The editing experience is a little wonky for them because between the node edit form and the In-Place Editor, there's too many ways to skin a cat.

So, with our new department sites roll-out, I'm trying something new and moving away from Panels and going all in with Paragraphs. An immediate roadblock I ran into was How do I embed a View in my paragraphs page?

Viewreference module + Paragraphs

After asking around in Drupal IRC, a nice fellow pointed me in the direction of Viewreference. Once I came across this module, things started falling into place.

At a glance
  1. Install module
  2. Create a Paragraph bundle called "Embed view"
  3. Add a Viewreference field to the bundle
  4. Viola! Embed your views.

Install module

[code]drush en viewreference -y[/code]

or download, unpack and upload to your module's folder.

Create a paragraph bundle called "Embed view"

Add a view_reference field to the bundle

Now you can embed Views within a Paragraph bundle!

The result: