I think a simple and very usefull addition to the flexinode module would be the ability to limit the flexinode table by taxonomy using a URL.

For example right, now the module will create a table for 'flexinode 1' ordered by 'title' using.

flexinode/table/1&sort=asc&order=title

Wouldn't it be great if the table could then be limited by taxonomy terms by:

flexinode/table/1&sort=asc&order=title&term=1

This would make flexinode a simple but very powerful tool for presenting a lot of data to the user.

The Nodelist module gets close... but it only outputs title, author, and date created - it doesn't dig in to the power and flexibility of flexinode.

I realize flexinode is under a lot of revisions, but I think this might be a simple quick hack... Unfortunatly I am not much of a programmer or I would try to do it myself. Maybe someone out there already has. If so I would love to see your code!! Thanks.

Comments

JoranLawrence’s picture

Title: Flexinode Table limited by Taxonomy » Flexinode Table by Taxonomy Term

I am a drupal newbie but I figured this one out on my own and I thought it might be useful to post my solution. However, it is a hack job!!!

I just added the following to flexinode.module in function flexinode_page_table (about line 258):

if ($_GET["term"]) {
   $tid = $_GET["term"];
   $table_joins[] = 'LEFT JOIN {term_node} tn ON n.nid = tn.nid';
   $where_clauses[] = ' tn.tid = "' . db_escape_string($tid) . '"';
}

Now, you can call the page by flexinode/table/1&term=1 and you will get a nice table with flexinode-1 type nodes for taxonomy term 1.

If you link this with a custom block like the one described at http://drupal.org/node/24989 , you can create a powerful "drill down" menu that lets a user limit a big list of nodes until they find the ones they want.

I am a drupal newbie, so any comments, corrections or thoughts would be appreciated.

I hope this is useful.

firebus’s picture

thank you. thank you. thank you.
this should be merged with the flexinode module.

Marandb’s picture

I cannot get this to work for me. I have made all the changes explained and the table contents do not change when I change the address.

I am using the Fleximax version of Flexinode. Does this make a difference.

This would be VERY valuable if I could get it to work. Any ideas?

Thanks,
Marand B

stevryn’s picture

Im looking to have a table of a certain flexinode data, with the ability to limit it to specific users....any ideas? It seems flexinodes tabular view could be really handy if you could use various fields as "filters"

darius’s picture

Great modification, thanks! Works with no problems. For those who still have problems:
1) Put the new code right after

// Build the query.
  $fields_to_select = array();
  $table_joins = array();
  $where_clauses = array();

2) What is the syntax you're using to view the table (should be something like .../flexinode/table/1?term=11)

Darius