Drupal 6 (+implementation)

Anselm Heaton - June 26, 2008 - 08:59
Project:Views Union
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

Hiya,

I wrote a module that performs a similar function for Drupal 6. I was going to create a new module when I realised there was this existing Drupal 5 module ! It's not a port of this module, it's a re-implementation but since it performs the same function, it might not make sense to create a new module.

The module works by creating a Views filter, which lets you select any number of existing node views, and then only return nodes that are in one of those views. (It is also possible to ask it to return nodes that are in none of those views).

Internally, it works by running the query of the other views in temporary tables, and then joining those tables to the main query. This appeared simpler than trying to merge all the queries together !

The queries creating the temporary table are run during hook_views_query_substitutions. It works perfectly fine, though obviously this hook wasn't meant for this ; I will look for a cleaner solution in the next versions.

So - does it make sense to merge those projects, or do you think I should create a separte module ? The module is attached btw - it's called 'merge_views' at the moment !

AttachmentSize
merge_views.tgz1.73 KB

#1

txcrew - September 21, 2008 - 19:22

+1 for this functionality in D6

I can't seem to get this mod to work with the latest version of views 2. Does it still?

I assume views_union is going to upgrade to D6, but since Views hasn't stabilized yet, it has yet to get a release date.

txcrew

#2

Anselm Heaton - September 22, 2008 - 10:25

Hi txcrew,

Attached is the version of merge_views which works with Views post RC2 (didn't test it with RC3, but I don't think there was any major changes between RC2 and RC3).

I posted this issue here three months ago, and didn't get any feedback from the developers so I guess I will make merge_views into it's own module at some point. Feel free to use this version in the mean time ; but note that at this point there is no guarantee this will be maintained in the future.

Anselm

AttachmentSize
merge_views-6.x-1.dev_.tgz 1.84 KB

#3

txcrew - September 22, 2008 - 14:44

Hi Anselm,

Great module! Very simple to use. I understand this module is currently 'unmaintained' and cannot really be supported and this is not the time or place for questions about it, but I cannot help myself....does this only work with views that are node types (not comments, files, etc.)?

thanks!!

txcrew

#4

Anselm Heaton - September 22, 2008 - 16:24

Yes, it only works with nodes. It shouldn't be too much work to adapt it to other content types ; though I won't have time to look at that myself for a while.

#5

Flying Drupalist - November 4, 2008 - 21:06

I need to put 2 taxonomy views together, I hope somebody can port this to d6 with terms enabled.

#6

Anselm Heaton - November 5, 2008 - 11:30

@Miraploy : You can use the Views Or module to do this. Views Or will be deprecated when the feature gets into Views proper ; but in the mean time it's the only options for D6.

You can also use the views_merge module I posted above - but I would recommend using Views Or instead (I will maintain Views Or ; while I won't maintain the module I posted above).

#7

Flying Drupalist - November 5, 2008 - 15:13

Thank you Anselm Heaton, I thought about using the Views Or before, but the message about it being deprecated scared me. But to see your reply means I can use it confidently. Thank you.

#8

hamaldus - June 14, 2009 - 11:45

+1 subscribing

 
 

Drupal is a registered trademark of Dries Buytaert.