Views Developers

Events happening in the community are now at Drupal community events on www.drupal.org.
This group should probably have more organizers. See documentation on this recommendation.

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?

Posted by mattmm on February 6, 2009 at 5:40pm

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 more
5 comments Categories: , ,

Seeking best way to add dynamic navigation to top of views page

Posted by mitz on February 4, 2009 at 5:18pm

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 more
4 comments Categories:

Display the $count in teaser views in Views 1

Posted by bflora on February 4, 2009 at 5:21am

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 more

How best to get a all nodes from a superset of one taxonomy term?

Posted by marqpdx on February 3, 2009 at 9:38pm

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 more
Categories: , , ,

Adding Order By to Views

Posted by andrew1056@drup... on February 2, 2009 at 9:41pm

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

Posted by bcn on January 28, 2009 at 8:52am
Last updated by mikeker on Sun, 2009年12月13日 20:07

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 more

View to display a master and the first child?

Posted by kirilius on January 28, 2009 at 4:45am

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 more

Views and Taxonomy Image

Posted by shushu on January 18, 2009 at 8:35pm

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 more

Subquery horror

Posted by Garrett Albright on January 15, 2009 at 11:02pm

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 |
+----+-----+-----+
Read more

Group by users.name

Posted by mp on January 15, 2009 at 4:00pm

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

Read more
14 comments Categories: , ,

Suggested template files for views

Posted by degeer on January 15, 2009 at 3:51pm

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 ();

Read more

Looking for a way to relate views block to a user Blog.

Posted by amirtaiar on January 2, 2009 at 11:10am

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

Read more
2 comments Categories:

Replacing the query engine

Posted by gordon on December 19, 2008 at 12:30am

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 more
1 comment Categories:

External DB via hook_views_data not appearing anywhere

Posted by bstoppel on December 18, 2008 at 10:08pm

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()
{

Read more

Creating a filter for multiple / no fields?

Posted by pukku on December 17, 2008 at 4:40pm

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 more

Modifying the exposed filters form in a display plugin?

Posted by pukku on December 17, 2008 at 4:34pm

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.

Read more

Views2 nodes summary by taxonomy - 2nd depth only , possible ?

Posted by avior on December 14, 2008 at 10:44pm

Hi

I have a location vocab with region & country

Region1
|_country X
Region 2
|_country Y
|_country Z

i 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 more
7 comments Categories:

Custom Fields and Filters in Views2

Posted by kswan on December 11, 2008 at 5:10pm

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 more
7 comments Categories:

views_embed_view - how to pass views argument ?

Posted by WuffWuff on December 8, 2008 at 10:53pm

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 more

Using views 2 for generic database applications

Posted by dwilliams-gdo on December 5, 2008 at 10:43pm

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
Categories:
Subscribe with RSS Syndicate content

Views Developers

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /