views:

44

answers:

2

how could I concatenate 3 views in one page ?

Should I use blocks ?

+1  A: 

It probably depends on your layout. if you want to embed a view in somewhere else besides your block regions, you could try the embed views module I also believe the the panels module has a much more dynamic way of rendering multiple views on the page (but flexibility also adds some to the complexity)

CEich
+2  A: 

You can use blocks, but Views provides an attachment display as well. Attachment displays can be attached other other displays within the view. So, you could create your base view, then create an attachment display that attaches to the base view, and then create a second attachment display which attaches to the first attachment display.

Attachment displays are good if each view is really just another way to view the same query (like, a summary view and a detail view). But if you wanted to combine three disparate views, blocks would be the way to go. Either create a block display for each view and add them to the same region in Site Building -> Blocks, or create a page display for one of the views and block displays for the other two.

A third option would be to use View Reference, which lets you reference views as CCK fields, if you needed the views to part of a node.

Mark Trapp
great. View CCK field works great. I've only one issue: I dunno how to display the title of each view field above it. I could use the label and somehow remove the ":" at the end. But it would be great to show the original View Title.
Patrick
Go into Manage Fields for the content type, then go into the Display Fields tab. There, you can change the formatter to "Full (Title + View)". Just make sure the title for the display is set on the view.
Mark Trapp
I only have Hidden - Default as options (see screenshot: http://dl.dropbox.com/u/72686/displayView.png). Are you using ViewField module ?
Patrick
No: I suggested [View Reference](http://drupal.org/project/viewreference) as a possible alternative to blocks or attachment displays. I don't know anything about ViewField.
Mark Trapp
ok, I've now View Reference, however, I'm using Taxonomy View and I cannot add a fixed title to the page. Usually the title is the term name passed as argument. Can I pass the title as argument as well from View Reference ?
Patrick
Yeah: you can either provide a default argument in the view, or, when you edit a node with the field, it provides a text field you can use to provide the arguments.
Mark Trapp
Ok, I want to provide a default argument in the View. I've selected add a new argument.. what should I choice ? Global:Null ? How can I assign this argument to the View title ?
Patrick
When you add the argument, select "Provide default argument" under "Action to take if argument is not present"; these questions are where I've explained this in more detail than a comment will allow: http://stackoverflow.com/questions/3474114/how-can-i-work-out-this-view/3484870#3484870 and http://stackoverflow.com/questions/3443484/node-reference-to-table-in-drupal/3485105#3485105
Mark Trapp
For the view title, when you create an argument, set the title of the argument to whatever you want, using %1, %2, etc. for the value of each argument. So, if you wanted it to be "News: 2010", you'd add an argument, News: Created Year, and make the argument title "News: %1"
Mark Trapp
I've tried to write %1 in the View Title but it is not interpreted as argument.. it just writes %1 in the html page.
Patrick
Also, I didn't get the part in which you suggest to use "Action to take if argument is not present" in the nodes fields options. I actually need a title for the entire view not just for each node of the view. Sorry if I misunderstood.
Patrick
When you create an argument in a View, it rewrites the title for the whole view, not the title for each row. It looks like Viewreference doesn't support argument replacement in titles: http://drupal.org/node/828554 I think, if you need that, you might have to go with the Block/Region route instead of CCK.
Mark Trapp
Well, I will create 3 view references fields and 3 CCK text fields for the title, then. thanks
Patrick

related questions