2

I am working on a Drupal 7 website where there are many pages which utilize multiple views.

The way I am doing this right now is by creating a page from Drupal admin panel, and in the edit mode of that page I am calling views_embed_view to display those multiple views.

enter image description here

Other ways I could do this is by creating a template for that page, and putting my code inside the template.

Yet another way is to use View Fields View (https://drupal.org/project/views_field_view) and embed the second view inside the first one.

I want to know, performance wise which is the best practice?

4
  • 1
    your job (call views by views_embed_view has better performance that Panel module. because panel module add more query in call,), bye default drupal cache views even in calling by views_embed_view . good job
    – Yuseferi
    Commented May 26, 2014 at 4:59
  • is my way better than putting the same thing in a page.tpl.php file @zhilevan ?
    – Shuaib
    Commented May 26, 2014 at 15:43
  • I think another way is create a php block and call them in it with your php code, it use block caching,if you put in page.tpl.php maybe it has a little more performance(fewer query ) but if you want to follow MVC structure of drupal use views and views in views .
    – Yuseferi
    Commented May 26, 2014 at 16:32
  • You should not use php code filter, it's it's a wrong behaviour. Commented May 27, 2014 at 7:52

3 Answers 3

2

You can try panels to display multiple views on a single page:

The Panels module allows a site administrator to create customized layouts for multiple uses. At its core it is a drag and drop content manager that lets you visually design a layout and place content within that layout. Integration with other systems allows you to create nodes that use this, landing pages that use this, and even override system pages such as taxonomy and the node page so that you can customize the layout of your site with very fine grained permissions.

Panels includes a pluggable caching mechanism, so it could be a good and easy option for you.

0

Definitely Panels is a really good way to go, it will allow you to create pages and add them views or fields of entities if you use the context tool that comes with the module.

A couple of other things that might become handy are EVA module that allows you to attach a view to an entity render page.

0

You can use header and footer section of the view to show other views.

Step 1 : Create a view which is your own output to show.

enter image description here

Step 2 : Select add footer in your view and select "Global : View area" option to insert other view which you to show on that page.

enter image description here

Step 3 : Now you can select any view which you want to show on that page.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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