Views Developers

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.

jiatao's picture

Related articles by texonomy

Trying drupal for the first time, great system, very easy to use once over the learning curve.
But ran into a wall when tried to create a link of the headline of a related post.

So, I am trying to make a little block displaying the day's top headline, nothing fancy just the latest piece of news article displayed with picture, title and summary, all created in an easy view block.
But in addition, I want to put only the headline of another article related to the top headline by author entered Tags.

Read more
ppc.coder's picture

Sorting on a fields from a referenced content type - NULL values

Hi again,

I tried searching for this but couldn't find the right keywords :P I'm sure this is a common requirement.

What I want to do is sort my view on a field from a referenced content type. But the problem is that the sort column is coming back with all NULLs.

For example, say I have 2 content types: Sales and Province, where the Sales table has a node reference to Province. The Province type has a Display Order field that I want the view to be sorted on.

Read more
ppc.coder's picture

Help with programmatically adding fields to view


I am trying to get views_crosstab to work and have made some progress but am stuck on how to properly add new fields to the view. I am trying to fix this ( line 187):

// Add a "Total" column.
// TODO: Add an option for this.
1. $alias = $crosstab_columns['alias'] . '_total';
2. $this->view->query->add_field(NULL, 'SUM(' . $crosstab_data['table'] . '.' . $crosstab_data['field'] . ')', $alias);
3. $this->view->query->fields[$alias]['aggregate'] = TRUE;

Read more
jaysonragasa's picture

Implementing Views with Arguements in Nodes

Hi guys... It's my 2 weeks in Drupal and am doing a project which was called "Market Price Watch".

Here in our local city, we have a buy and sell site which I do not own.. most of the sellers put an overpriced item and the admin have no control with it.. (I mean he cannot say to sellers to lower their prices base on the current prices of the gadgets)

Read more

List of examples to be created for views_plugin_examples

Here we need to create a list of example modules to be created for a brand new project:

Please feel free to chip in with ideas.



  • Pager plugin - Done by merlinofchaos (D6)
  • Style plugin
  • Row style plugin
  • Display plugin
  • Access plugin
  • Area handler
  • Query plugin
  • Argument default
  • Argument validator
  • Cache plugin
  • Custom Exposed Filter (eg. substring search over several fields with one search box)
  • Read more
    isaachorton's picture

    How can I build a view that adds an alphabetical ID (A-Z) to each list item? so 1st item is #a, 2nd is #b, 3rd is #c, etc.???

    Im trying to create a simple view that assigns #a-#z ID's to list items.
    also does anyone know if its possible to load every 2nd and 3rd list item with an alternate (bigger) image?

    Does anybody know how to make that happen?

    Read more
    rpeters's picture

    Views feature

    I was wondering is there a module or a feature in views where that user can edit a content in a view instead of going to find that content that is being used in view.

    Read more
    tejaspmehta's picture

    View has no data but still displaying in block

    Hello All,

    I was building one theme based on fusion theme. Now all elements are set properly. Now i have created a view which is displayed in block. View display images of particular node if that node has image in CCK filed. So i created view with argument as Node:nid and Provide default argument and Node ID from URL. This works fine for all those nodes which have images. But when any node do not have any image at that time it should not display. But my problem is it is displaying. I have attached screen-shot of how it looks.

    Read more
    ben.hamelin's picture

    adding a form to any page of the site that will submit to existing exposed view block

    I have a view, displayed as a block, with exposed filters, assigned to one page node on my site.
    This is a simple search form with a Taxonomy drop down, keyword search for name, and a few other simple filters.

    My problem is that I want to include an additional form on other pages of the site (a sidebar block for example) that will submit to this view.

    Is this possible?

    I'm testing now, but have yet to produce results.

    I copied the HTML of the form and used that as my starting point.

    Of course, this view uses AJAX as it has exposed filters and is output as a block.

    Read more
    mikeytown2's picture

    Views Conditional Filter

    I'm well aware of Views Or; I'm looking for something that would do a Conditional Filter. Example:

    I have a CCK field called showcase. If there is any node with the showcase field set to TRUE then I only want to display nodes of that type. But if none of my nodes have showcase selected then I would like to ignore this filter to still display nodes in this view. View has a random sort; also using sorting to do filtering doesn't seem like the correct way to do this.

    Has anyone created a views plug-in like this?

    Read more
    mikeytown2's picture

    Use Javascript (no ajax) for Views sorting - Have random sorting on cached pages

    We have some hacked up tpl files to accomplish this goal, but I'm looking to create a module where one can select "Global: Javascript Random" as an option. We want to use this elsewhere so a views plugin sounds like the right thing to do.

    Read more
    hamedtaha's picture

    Rendering View Result as a Control within another View..

    Hi All
    i'm trying to make a view which i can do some operations like this image [attached]
    Only local images are allowed.

    the Registerlinks is shown based on the user Roll , and i want to send an argument within that link
    is that applicable ?

    Read more
    kirilius's picture

    How to create a dynamic drop-down exposed filter?

    I have a node type Gallery and I am building a view that displays each gallery as a grid of thumbnails. The view has one argument: Node ID. I need to add that as as an exposed filter so the users will see ALL galleries in a drop-down list and when they select a gallery, it will be displayed below.
    The catch is that the list of my galleries is not static - I can add/remove/rename existing galleries. Basically I need the drop-down list to be populated from another view.
    What is the best way to do this?

    Read more
    bellHead's picture

    Management of root and leaf items in taxonomy vocabularies

    I have been making friends with Views quite rapidly over the past week having previously used custom developed modules possibly a little too much.

    I'm finding it difficult to manage the behaviours required at the root and leaf of a hierarchy which are different from the middle of the structure. I would like to contribute some additions but would first like some feedback on whether the changes would be in line with the Views project in general and which of the possible routes would be least painful to develop.

    Read more
    rjleigh's picture

    Inner joins with MAX in hook_views_data()

    I have a custom module that records a specific module status history per node. The table has several fields, but here the important ones are nid, a timestamp field and a status text field.

    My module just keeps adding to the table to keep the full history of changes.

    If I wanted to use an SQL call to view the latest entry for each nid, I'd use:

    SELECT a.nid , a.timestampfield, a.textfield
    FROM (
      SELECT nid, MAX(timestampfield) as maxtime
      FROM mytable
      GROUP BY nid
      ) as b
    INNER JOIN mytable
    AS a
    ON a.nid = b.nid
    AND a.timestampfield = b.maxtime;
    Read more
    Remon's picture

    VARQL, a Views SPARQL Query Plugin

    Hi, yesterday I've released VARQL (SPARQL Views Query Backend), the module is intended to help in generating SPARQL queries using our Views lovely and intuitive UI.
    VARQL utilizes Drupal 7 built-in rdf mapping in building SPARQL queries; for example if you want to select a couple of recored from DBedia, namely, name and homepage, varql will map these fields to foaf:name and foaf:homepage respectively to build a query

    Any reviews or feedback would be greatly appreciated (especially regarding RDF mapping and views query plugin).

    Read more
    gregorychandler's picture

    Best way to enable triple tags

    Hi there! New to Drupal. I need help.

    What module(s) or resources are best to help me enable triple tags, where:
    1. Each tag is composed of a subject, predicate, and object.
    2. The subject, predicate, and object can be chosen by users from specific nodes on my site. Each field can suggest nodes as you type.
    3. Two nodes with the same name can be differentiated by an ID or something.

    My goal is to link my nodes into a linked graph that can be queried by something like views. I want to display the relationships between nodes (the graph).

    Read more
    timting's picture

    Modifying Views Filters programmatically

    I've been trying to create a view for blog posts which given the url, say, "blog/after/2010/02/02", will take those arguments and give me the 10 entries in my blog after 2010/02/02. I thought it would be relatively simple, but I haven't been able to find enough information on the web in order to do this. I'm not sure if I've taken the right approach. I've used as a template to use the hook_views_pre_view() function to access my view's filters (I've created a created filter on the blog entry post date) and modify it with the arguments on the URL.

    Read more
    johdax's picture

    json data expose to views

    I have a custom CCK compound field, which stores a hierarchical multidimensional tree in json in a field type. I now want to expose this data to views, but in flat way (table with parent relationships).
    Any help with how to implement views_data is appreciated.
    kind regards, thanks in advance

    Read more
    wrburgess's picture

    How does Views query multiple taxonomy terms tied to content?

    With Views, I already know how to render multiple taxonomy terms that are associated with a single piece of content. What I can't figure out is how Views actually queries the database to get the job done.

    For example, this is easy to set up in Views:

    Title: "Brett Favre is Hurt"
    Body: "blah blah blah"
    Tags: Football, Injury

    Title: "Cliff Lee Signs Contract"
    Body: "blah, blah, blah"
    Tags: Baseball, Free Agency, Philadelphia

    Read more
    Subscribe with RSS Syndicate content