This group exists as a place for people interested in the group to talk about Views development; all development talk is encouraged here, from people who want to work on Views core to people who are interested in Views' API for their own modules. This is a good place to:
1) ask questions
2) talk about problems
3) propose ideas.
4) talk about views related projects.
This group is now unmoderated, and anyone can join at any time. Public posting of ideas is encouraged.
What I want most out of this is to keep track of what views related projects are going on and their status, and proposals for what people would like to see as Views moves forward.
Note: This is a working group. Do not post jobs here, you will lose your posting privileges entirely. Do not post support requests here; they will be deleted.
User defined search - is exposed views the answer?
When wanting an anonymous user to define search paramaters, is views exposed filters the answer? Is there a module that works with views to handle this task?
Read moreSeeking best way to add dynamic navigation to top of views page
Hi,
I'm new to views. I figured out how to make a views page using 2 wildcards. I'd like to enable my users to drill down from there depending on the first letter of the last name. I have this working if I type in the URL by hand, but I want to add a nav bar to the top of the page like so:
A | B | C ...
Read moreDisplay the $count in teaser views in Views 1
I've been working with views 1 for a few months and I've found something I don't know how to do.
When theming a "list" style view, I'm able to add the variable $count to the view's theme file to number the nodes in the view. 1, 2, 3, 4, etc.
How can I number the nodes in a "teaser" style view? 1,2,3,4 like that?
Is there something other than $count that I can use to do that?
Read moreHow best to get a all nodes from a superset of one taxonomy term?
Greetings,
I am hoping someone can help me with the logic/approach part of this problem:
I have a superset table of term data, so that if a user selects "Dance" i want to run a query and get all nodes with a term of "Dance" or "Polka" or "Tango" etc.
Read moreAdding Order By to Views
I'm working on the uc_auction.module and have come up with corrected views code that looks like this:
class uc_auction_handler_field_high_bid extends views_handler_field {
function query() {
$join = new views_join();
$join->table = 'uc_auction_bids';
$join->field = 'bid';
$join->left_table = 'uc_auction';
$join->left_field = 'high_bid';
$join->type = 'LEFT';
$this->query->queue_table('uc_auction_bids', NULL, $join);
$this->query->add_field('uc_auction', 'start_price');
$this->query->add_field('uc_auction_bids', 'amount');
}
function pre_render($values) {
$this->field_alias = $values[0]->uc_auction_bids_amount == NULL ? 'uc_auction_bids_amount' : 'uc_auction_start_price';
}
}The problem is that when I go to sort it, it gets sorted on high_bid, but I want to sort it on uc_auction_bids_amount.
So, not being able to find too much views examples of this I have come up with this:
class uc_auction_handler_sort_high_bid extends views_handler_sort {
function query(){
$this->query->add_orderby('uc_auction_bids', 'uc_auction_bids_amount', $this->options['order']);
}
}I know this isn't right because it doesn't work, but if somebody could point me in the right direction it would be a huge help. Read more
Modules that rely on views
As suggested at http://www.angrydonuts.com/asking-for-a-little-help-from-the-community-n..., this is a place to list module that rely heavily on views.
Please list the module name, a link to its project page, and,
Read moreView to display a master and the first child?
I have two node types - A and B. B has a nodereference to A, thus one A (parent) has many B children:
A1
|-B11
|-B12
|-B13
...
A2
|-B21
|-B22
|-B23
...
I need a view that displays a row per A-node along with one of A's children (the first, a random, etc.). Example:
A1 B11
A2 B21
A3 B31
I saw a podcast showing how to do the reverse: for each child, use the Views relationships to show the parent's title for example. That's clear but I need it top-down: for each parent show one child. How can I do this with views?
Read moreViews and Taxonomy Image
Hello,
I created a "restaurant" cck, which can fit to one or more restaurant types (which is a taxonomy vocabulary).
My goal was to create a table view that will show the restaurant types as images (using taxonomy_image.module).
While taxonomy_image module do have Views integration, it lacks the "all terms" option, and makes duplications.
My solution was to enhance the views_handler_field_term_node_tid.inc to support taxonomy_image. Patch is attached.
I didn't want to create an Issue in Views before I bring this before your eyes, to get your feedbacks.
Read moreSubquery horror
I'm using Views 2 and want to know how to construct a query which, as far as I can tell, requires a subquery.
Given these tables;
Table foo:
+----+-------+
| id | title |
+----+-------+
| 1 | A |
| 2 | B |
| 3 | C |
+----+-------+
Table bar:
+----+-----+-----+
| id | foo | baz |
+----+-----+-----+
| 1 | 1 | 1 |
| 2 | 1 | 2 |
| 3 | 1 | 3 |
| 4 | 2 | 3 |
| 5 | 2 | 2 |
| 6 | 2 | 1 |
+----+-----+-----+Group by users.name
hello
D6, views2
to explain my problem will take some time, so be patient ;)
i have a taxonomy and it´s about fish ---> genus, species, subspecies, population.
on one site i want people to search after fishkeepers, so i made exposed filters where you can enter one or all of the terms (genus, species, subspecies, population).
if you view the site (without searching) then you get the exposed filters and below all fishkeepers. the problem is, if someone has 2 fish, then he is listed 2 times ... 10 fish - his name is 10x in the list
Suggested template files for views
I'm work on a site where we are using views to display various content. Our front-end developers have been instructed to work with tpl-files that are put in our theme. They have to be able to create template files in the same manor as they do for page, node, blocks - e.g. page-node-1.tpl.php, page-node.tpl.php etc.
I've come up with a solution where I re-use code from http://api.drupal.org/api/function/template_preprocess_node/6
Views
function phptemplate_preprocess_views_view( & $vars)
{
$i = 0;
$suggestion = 'views-view';
$suggestions = array ();
Looking for a way to relate views block to a user Blog.
Hello,
I have search a lot for this purpose and didnt find what I am looking for, hopfully here I will find an answer.
Yet I must say, my knowledge in PHP is non.
I am tring to Relate several views block I have created(like Blogrol, Archive) that relating the blog manager content to that blog page.
example:
Blog X
- Blog x Archive
- Blog x blogrol
Blog y
- Blog y Archive
- Blog y blogrol
and so on.
I have succesfully create the views but can't succeed the relationship.
I found this mission importent and can be input in ather mission's as well.
Thank you
Replacing the query engine
Hi,
I have just had a flash of brillance/madness (40% brillance/60% madness) and was wondering if it is possible for a top level table to replace the query object with a completely new type. Which may or may not need to actually be a data field.
and example would be to replace the query object with a flickr object so that you can query flickr for different images based upon criteria which is past.
Read moreExternal DB via hook_views_data not appearing anywhere
I am trying to hook up an external database to Views in Drupal 6. But am having some difficulties. Here is what I have done:
Added a DB DSN for the the external db to settings.php. (The external MySQL is on a separate machine than the MySQL that runs Drupal.)
Created and enabled a custom module called digir .
Created the info file digir.info.
Created the digir.module (empty right now) .
Created the digir.views.inc files with the following code:
NOTE: that database is digircahe and that table is fish_tissue_digir_cache.
<?php
function digir_views_data()
{
Creating a filter for multiple / no fields?
Hi! I'm trying to implement a "quick search" filter, which would be one filter that could search multiple fields. Is there any way to define a filter that isn't tied to a particular database field?
Thanks...
Read moreModifying the exposed filters form in a display plugin?
Hi! I'm writing a display plugin which needs to have a form at the top to control some display options. In order to allow users to set the display options at the same time as they set any filter options, I need (I think) to put the display options into the exposed filters form.
I can force the form to be rendered by implementing uses_exposed() in the display plugin. Right now, I then use hook_form_alter() to modify the form, and then process the results of the form submission in the display plugin's query() function.
Views2 nodes summary by taxonomy - 2nd depth only , possible ?
Hi
I have a location vocab with region & country
Region1
|_country X
Region 2
|_country Y
|_country Zi want to be able to do display nodes summary view but only by 2nd level (countries only)
country X (12)
country Y (2)
country Z (7)
If i use "Taxonomy: Term ID" as an argument (Summary, sorted ascending,validation set to taxonomy term by the vocab),
I get all countries but also the regions
how can i drop the regions ?
I even used the "Taxonomy: Term ID depth modifier" , with no success
hope someone can guide me how to do this
Read moreCustom Fields and Filters in Views2
I have a case were I would like to add an SQL calculation to the SELECT clause of a Views2 query. For this specific case, I would like to add something like "(TO_DAYS(NOW) - TO_DAYS(field_due_date)) AS days_late". I am sure there would be other cases that would benefit from this feature as well, such as a UNIT_PRICE * QUANTITY.
I think that it would be useful for advanced site administrators to enter their custom SQL statement that would be inserted in the query. Similar functionality would apply to both Fields (SELECT clause)and Fiters (WHERE clause).
Read moreviews_embed_view - how to pass views argument ?
I am working with Drupal 6.6 and the new views 2 module. I am trying to output a view after executing some PHP code. My site has a form that enables visitors to search nodes - a company and a program node. One company can have many programs so I have used the node reference function to create a mini relational database. An example of a search might be to choose all programs that are in Argentina, are under $1000 and last 5 weeks. The php part that builds the sql works fine and the results of the query are Node IDs.
Read moreUsing views 2 for generic database applications
I have been spending some time getting up to speed with views 2 and I really like it so far. Looking at the code, it seems that this module along with drupal can be used to build generic database applications (I have a feeling there is some kind of industry buzzword for this but I am not sure what it is).
Read more









