Tips, tricks, articles, rankings for Drupal developers

Rendering Views in Drupal code with views_embed_view

Manel's picture
Manel | Tue, 15/04/2014 - 11:57

Use the provided PHP code to render a view. The first parameter is the machine name of yout view and the second is the view display.

<?php echo views_embed_view ( 'name_machine_view' , 'block_1' ); ?>

Rating: 
5
Average: 5 (3 votes)
Drupal version: 
Drupal skill: 
Dependencies: 
PHP programming language, Drupal Views UI

Comments

ballester's picture
Submitted by ballester on
Rating: 
5
Your rating: 5

Very handy for complex websites! Thanks man!

damaya's picture
Submitted by damaya on
Rating: 
0
Your rating: None

I think it's basic if you want to combine diferent view. I didn't know it, but surely it's useful. Good job!!

damaya's picture
Submitted by damaya on
Rating: 
0
Your rating: None

Thank you for sharing. 

damaya's picture
Submitted by damaya on
Rating: 
5
Your rating: 5

I forgot it! Take your 5 starts!