Concatenating 3 views in one page - drupal

how could I concatenate 3 views in one page ?
Should I use blocks ?

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.

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)

Related

Is there a drupal 7 module to change/filter content in a view via tabs that are not placed inside of the view?

I have a library page with some taxonomy topics(resource types) that are currently being filtered by some really hacky tabs that I would like to replace to do two things:
1) get new, more user friendly tabs, with the capability to be placed outside of the view yet change content inside the said view.
2) be able to have the tabs grouped together in a way I can manipulate them with css.
I am fairly new to the drupal world. What would you suggest? Thanks!
Do you use exposed filter options?
If so in the advanced tab of the view you have a option 'Exposed form in block' this way your exposed filters will be placed in a seperate block.
After saving the view you have to enable the block

How to show two views on one page in drupal

How can I show multi views on single page in Drupal?
I need to show two results, (maybe you can think 2 tables, but actually 2 views) on one page.
Anyone please help me.
You can use the panels module. That will allow you to put views in different types of layout on a page. And take arguments as required.
You can do it by creating a page with your first view. For the second view you have to create a block and add it to that page.
btw: please use https://drupal.stackexchange.com/ for drupal specific questions...
As laebs suggested one way is to create block view and to add it to some region when your page is displayed.
Other way would be embedding the view from template file:
https://api.drupal.org/api/views/views.module/function/views_embed_view/7
With this function you can specify which view and which display you want to embed. You can also pass the parameters this way.
And notice that you have "embed" display type (it may be hidden by default - check view options). If you use it you'll also get those nice "edit view" links when embedding view this way.
There are two ways that I know of without using other modules:
Use the Views Header/Footer area to load another view. Just click "Add" in the Head/Footer area of the Views UI and you should see "Global: View area".
Create a page template and insert the views that you'd like to have on the page within the template using some Drupal API php:
<?php
$view = views_get_view('view_machine_name');
print $view->execute_display('default', $args);
?>

I need to use a View as a 'Content Type' in Drupal 7

I'm creating a view that needs to display two content types - a normal content type, and a view. The view needs to display three items in a row - the first two items of the normal content type are the first two items in the row, and the view needs to be the third.
I have tried Viewfield and Views Field View, and neither have done what I need them to do. I need to be able to add the view as one of the 'Content Types' that the view is picking up.
Is there a way to do this Viewception?
So, if I'm getting this right, you need a view to display a normal content type, and then a view along with it?
You can always make a view of the content type, and then attach another view to it.
What is the source of the attached view's data?
man dont do this, it will be very slow query and it will kill your webserver after a few page requests
you need to build this as a custom block with a custom query (or event multiple queries), but also check your query speed. leave me a message when you need help with building custom block or building the query

How do I make a template file for a specific display in a view when I have multiple displays of the same type

I have a view that I am using for articles on the front page (View called Frontpage Top).
in one BLOCK display (named: Top Story) it just selects the most recent article.
in the other BLOCK display (named: Top 5 Stories) it selects the 2nd-6th most recent.
I need to make a template for the single top story, and then another to display the other 5.
this template:
views-view--Frontpage-Top.tpl.php works, but it's being used for BOTH blocks.
The only way I know how to do this is with multiple views, but these are so closely related I'd like to keep them in one. Is this even possible, and if so what would the filename look like?
it doesn't seem to be documented in Views2 ( http://drupal.org/node/352970 )
and this ( Drupal: Views, can the displays have different styles for the view? ) is close but not the same.
If the "right" way is to create multiple views I am ok with that, but I cannot find a resource saying that and I'd prefer not to if I don't have to.
Thanks!
Each display can be themed independently from another. In the Views admin, go to the display you want to customize and click on "Theme: Information". This will show you all possible templates and naming options you have. See the image below:
If you see in the image above, you can create a template for specific displays in a view. For example, all of my displays in this view are Page displays. So to style the "Business Cards" display (the 2nd display), I could use "views-view-grid--Vendors--page-2.tpl.php" to change the Style Output. The page-2 specifies that you want the template to handle your 2nd page display in this view.
If you need more information, take a look at Views 2 Theming Documentation

drupal replacing default nodes with views page

I have created a page view using field style to display a list of teasers as I want. fields configuration in views allows us to link the field to it's node. but what if we have created view for node detail page and want field to link to it's relevant view.
I had the same question, and after a bit of research this is what I've concluded:
The views module isn't intended to replace a default node view. I say this because of the level of difficulty involved in doing this and the lack of information on how to accomplish this. Ryan Weal has posted a way to accomplish this by editing your node template that doesn't look too difficult to accomplish, and here is the link.
However, it seems that a more popular solution, especially if you are like me and don't like to get into editing theme files. You can use the Display Suite module to effectively reformat the default node content as you would like.
I'm not sure if I understand you properly, but it sounds like you are wanting to display a view in a page view of a node?
In order to do this, you could:
create a small module, using hook_nodeapi() or one of the D7 replacements for this function in order to insert the output of the embedded view into this page's content, by conditionally adding a $content element when the node is of the appropriate id
or (easier, but requires allowing input type PHP) embed the view right on the page.
http://thedrupalblog.com/embedding-view-drupal-6-using-views-embed-view for information on embedding views

Resources