DISCLAIMER: I am a Drupal noob so my apologies up front for my ignorance...

I have spent the last few days trying to figure out (1) How to insert a view in into a specific location on a given node; and (2) The best method given my specific scenario.  Also, the reason why I need to insert at a specific location is because I want the ability to wrap the view with other content, within accordians or tabs, etc.

During my search, I found a few different modules\methods to get the insertion accomplished.  For example:

  • EVA module
  • Insert view module
  • Entity embed module
  • References module
  • Entity references module
  • Custom PHP code in template files

These modules\methods - used either individually or together - can get a view inserted into a node however I am not able to control specifically where the view is inserted on that target node.  The only way I could find to get that level of insertion granularity was via the Embed View Shortcodes module - it does exactly what I need. 

So then, my question is this: Is there any way to get that same insert location granularity using the methods listed above?  What, if anything, am I missing?

The reason I'm asking is because I can see compelling use cases for these modules\methods so I have to believe other Drupal users would also need to control - at least in some situations - exactly where to insert a view.  Perhaps not but my gut tells me I'm missing something here.

Thanks in advance for any insights you can provide.

Comments

wombatbuddy’s picture

...however I am not able to control specifically where the view is inserted on that target node.

 What do you mean?

I think that I can provide a help with 'EVA' or 'Entity reference' modules. But  I don't understand what do you need to do.
Can you explain in other words your task? Or maybe you can to illustrate it with some images.

jaypan’s picture

I just used the Views Reference Field on a project this week, and it works quite well. These days for pretty much any project, I set most content to be built with Paragraphs. You can create a paragraph with a Views Reference, and then you can drop your view into any entity or node.

Contact me to contract me for D7 -> D10/11 migrations.

cyberzeus’s picture

Goal: Insert a View at a specific point within existing node content.

Explanation: The node content I refer to is essentially HTML code that sets up a framework of tabs on a Basic page.  Within these tabs is both dynamic (generated by Views) and static content and the content generated by the Views needs to be inserted at the correct location so it displays on the proper tab.

The basic page structure is provided at the end of this post.

All of the other modules\methods I have attempted (including EVA, Views Reference Field, etc.) definitely allow the insertion of the View but they do allow me to make that insertion at a specific point in the page's HTML code.  Using Embed View Shortcodes does provide me with that ability.

Also, there may be other ways to build a framework of tabs on a given page and then insert View content within them.  If so, please feel free to elaborate on a better way to make it so.

Thanks once again in advance for any insights you have...


BASIC PAGE STRUCTURE

TAB-1

View insertion for TAB-1 dynamic content

TAB-2

View insertion for TAB-2 dynamic content

TAB-3

Static content for TAB-3

TAB-3

Static content for TAB-4

bhaskar-chakraborty’s picture

If you are using the node tpl then you can use view_embed_view function to render a view in any point like this https://www.drupal.org/docs/7/modules/views-slideshow/theming/using-view...

wombatbuddy’s picture

Now I get it.
One alternative way, like you asked:

If you want to wrap your view with other content, within accordions and tabs then I recommend you to use 'Field Group' module.
For attaching a view to a node you can use or 'EVA' or 'View reference' (not 'Views Reference Field') modules. 
Then 'Field Group' module will allows you to place your fields in tabs and accordions in convinient way.

WorldFallz’s picture

Another option is the little more user accessible is the https://www.drupal.org/project/insert_view module. I haven't used it with d8 yet, but probably worth a try.