0

Using Drupal 7 - I have a view that displays all project assignments per employee. This view works properly and is displayed as a block on Department nodes.

I have another view that displays a page,"Department Directory". Where the directory lists fields of such as Department Name, Address, Phone, Fax, Email.

The idea I am trying to accomplish is to have a list of fields of the department, and then have it list the employee assignments. Example:

View Page: Departments:

Finance Department

Address 123

555-555-5555

Email@mail.com

(This is where the views employee assignment block fields would be displayed)

PERSONNEL ASSIGNMENTS:

John Smith: Complete Budget

Alan Wayer: Generate Monthly Expense Reports


Upon doing some research, the Views field view module gave me the results I needed, however, I read that this module is resource heavy. Is there a more efficient way that this can be accomplished?

2

Where did you read that Views is resource heavy? While there is some overhead to running Views, it is generally not significant unless you are getting enormous amounts of traffic. Your system sounds like it will be used internally, so I highly doubt that you will run into performance issues.

Views is a visual SQL query builder. It is also the most popular module for Drupal and one of the best supported modules. The alternative to Views is to write the SQL queries yourself, but unless you're a SQL expert this is error-prone and time consuming. You can always do everything in Views first and then re-write some of the queries manually if you run into performance problems.

| improve this answer | |
  • I was referring to the Views field view module ( drupal.org/project/views_field_view ) It seems perhaps this module will be good to stick with. – Hjones May 4 '12 at 2:24
  • Instead of the Views Field View module, you could also try using Views attachments or content panes and Panels. – Patrick Kenny May 4 '12 at 2:29
1

I agree with @Patrick Kenny. Views is not very resource heavy. And the queries coming through views are much more optimized than generally a normal programmer would write.

Plus there are caching options for views. You can set the caching time for views which will mean that the results will be cached. So now do you understand how powerful it is? Check the caching options under advanced section on the right side of the views setting page.

Now two embed views inside a view, there are quite a few options.

First and very simple is to embed the view writing a code on the header or footer. Although I agree that it is not the best way to do things. But then, sometimes such things are done to quickly turn things around. :)

Second is, if both the views are blocks you can write one block and using php code embed the two view blocks inside that block. And then you can place that block where every you want to.

And the last but a very good way is to use panels. But yes, its a big module and if you just to embed a view inside a view, this can be an overkill and this might be a bit resource heavy then.

Hope these methods help.

| improve this answer | |
  • I saw @Patrick Kenny post before this one. I will stick with the Views field View module as a solution and research caching options – Hjones May 4 '12 at 2:26

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.