Hello,

Is it possible to create a view that will show other views?

I have a content type "portfolio-item". I have a view with thumbnails of all the portfolio items of certain term, for example a page with thumbnails (in a gird) of all the "identity" portfolio items. There might be several pages of thumbnail for each term.

I have another view that's a simple full node view of portfolio items, sorted by a term.

I'd like the user to browse through each portfolio item, one by one. When he gets to the end of the all the items of a certain term, to have the next page be the thumbnail grid of the next term. After browser through all the thumbnail pages, he'll start viewing the nodes on by one of the 2nd term.

I was thinking of creating a view for each section: full nodes of term A, thumbnails of term A, full nodes of term B etc…

And then create another view that will run by all of these views…but I don't see how I can create a view of views.

Any tips would be greatly appreciated.

Idan Arbel

Comments

Mark Theunissen’s picture

Have you looked at Views Fusion and Views Union modules? I think Views Union will be what you require...

http://drupal.org/project/views_union
http://drupal.org/project/views_fusion

http://codebaboon.com

arbel’s picture

Hi,

thanks views union seems to do the trick...had to create a node and insert the grid view of the thumbnails into that node using view field and then created a view for that node type.

the only thing is that I get an sql error when I try sorting the master view:

user warning: Unknown column 'term_data.weight' in 'field list' query: SELECT COUNT(*) FROM ((SELECT node.nid, rand() AS random_sort, term_data.weight AS term_data_weight, term_data.name AS term_data_name FROM node node WHERE (node.type IN ('portfolio_category')) ) UNION (SELECT node.nid, rand() AS random_sort, term_data.weight AS term_data_weight, term_data.name AS term_data_name FROM node node LEFT JOIN term_node term_node ON node.nid = term_node.nid LEFT JOIN term_hierarchy term_hierarchy ON term_node.tid = term_hierarchy.tid LEFT JOIN content_type_portfolio node_data_field_thumbnail_image ON node.vid = node_data_field_thumbnail_image.vid WHERE (node.type IN ('portfolio')) AND (term_node.tid IN ('1')) ) UNION (SELECT node.nid, rand() AS random_sort, term_data.weight AS term_data_weight, term_data.name AS term_data_name FROM node node LEFT JOIN term_node term_node ON node.nid = term_node.nid LEFT JOIN term_hierarchy term_hierarchy ON term_node.tid = term_hierarchy.t in /home/meita0/public_html/peddington/includes/database.mysql.inc on line 172.

I opend a bug on thes, but I simply might be doing something wrong.

idan

arbel’s picture

hmm, after more checking and testing, I have another issue:

i'm trying to get the thumbnails view to "page" with the item views, so after the user browses through for example 5 pages of portfolio items, he arrives at a page of thumbnails of the next category, and if there are enough then the next page will also be thumbnails, and after that the pages will continue and be portfolio items.

at the moment with my sollution, the when the user reaches a thumbnail page, he has two pagers, one for the main view and one for the thumbnail view.

maybe i'm going about this the wrong way?

Mark Theunissen’s picture

I'm afraid I can't help you with the error, you did the right thing by raising a support request. I can suggest another module or two which may help you solve your problem:

Pageroute
http://drupal.org/project/pageroute
You can use the module to create a "route" which leads users through multiple pages

Workflow-ng
http://drupal.org/project/workflow-ng
Allows user defined workflows

Custom pagers
http://drupal.org/project/custom_pagers
Custom Pagers allows administrators to define context-sensitive previous/next pagers for any node type. The list of nodes to be cycled through is generated by a user-selectable view, and each pager can be displayed above or below the node body or in a sidebar block.

I'm finding it difficult to fully grasp what you are trying to do - but I think from the sounds of it, Custom pagers and Pageroute may be a good start. They are widely used modules.... I'm pretty sure they can be moulded into doing what you need.

Let me know how it goes... perhaps use custom pagers to go through the thumbnails, then workflow to trigger a redirect to the next set... it's a little bit of guesswork on my side since I haven't tackled your exact requirements in the past..

Hope that's of some benefit

Mark

http://codebaboon.com
Drupal based services

Mark Theunissen’s picture

Hmmm... if you were to enable custom pagers on the view that was a combination of sub-views... that may do it.

Mark

http://codebaboon.com
Drupal based services

ItalienskaTroll’s picture

How can I have a View of Views with Drupal 6?

Thanks!

calte’s picture

I'm looking for this as well.

mearns’s picture

I'm also looking for this

djschoone’s picture

i use two different types of content, both have the same field (an image). For the first i would like to use an argument and for the seconde an other argument.

Have not figured it out yet. From my MySQL background, i know i could fix it with an UNION, but within views (2)?

--
d-Media Web Professionals
https://d-media.nl

wvanbusk’s picture

One method to get a view of views in Drupal 6 is to make a content type just to embed views; e.g. named 'embed_views', and then use this code in the body after the teaser for created content items of its type:

print views_embed_view("viewname","page_1");

The embed_views content type (for inner views) can include an icon or other fields to display in a new view (outer view). The outer view can filter or reference this content type in order to display a table, carousel or other view style listing the inner views. A disadvantage is that you may have two titles displayed on an inner view, depending on your inner view settings and templates.

Cheers, Wade

joshuautley’s picture

Awesome. Thank you.

Josh Utley, President & CEO
Intrepid Network Inc. | Multimedia Services & Business Solutions

"Our mission is to provide a more personable multimedia service along with the highest quality business solutions."

stephane bouillet’s picture

Thnank you a lot for this simple code (last message), which I use in Drupal 7 to insert view in a story node.
As it is for a galleria slideshow, I removed the "page..." in this code, and it seems to work great !

So it avoids me to make a bloc of my galleria view, which I hat to put in the content of my node before finding this code !

So my code is:

<?php
print views_embed_view("viewname");
?>

Note: of course, you have to replace the "viewname" by the machine readable name which is of type "portfolio_name" (it appears as a comment by hover the name of your view in the view list)

Thanks again !