hi. i am wondering if it is possible to sort flexinode nodes by a certain type. i have created a field "date" for an event content type and would like to sort by date so that the events are displayed in chronological order. can i go into flexinode.module and add something somewhere to do this?

Comments

erikhopp’s picture

i suppose i should also mention that i am aware of the tabular view and that is not really how i want to show the data. so is there some way within the normal flexinode node list view that i can sort the nodes this way?

killes@www.drop.org’s picture

There is also a list view but that doesn't do custom sorting. Would be easy to add, though.

I'd need something even weirder: Sort flexinodes by vocabulary terms of a specific vocabulary.

erikhopp’s picture

if i try that on my site, it has some crazy visual results... two copies of the page are shown on top of eachother. along with page not found *and* the results of list.

so, you say it is easy to custom sort... well, i only need it for this one application, so i have been trying to add "ORDER BY flexinode_6.numeric_data ASC" on the end of one of the SQL queries in the flexinode module but have only come up with errors. how would i go about hacking this in? thanks. erik...

briandburnham’s picture

List view? How do you call up/generate a list view of nodes?

killes@www.drop.org’s picture

flexinode/list/n where n is the id of your flexinode type.

appel’s picture

Check out the handbook for flexinode views here:
http://drupal.org/node/74650

Hortalonus’s picture

That is exactly what I need too... Would be very nice.

mikeryan’s picture

The module this comes from has too much hard-coded knowledge of my site for contribution, but here's how I produce my directory pages:

function bynodetype_page() {
  if (strncasecmp(arg(1), 'flexinode-', 10)) {
    $pagetitle = t(arg(1));
  } else {
    $ctype_id = substr(arg(1), 10);
    $ctype = flexinode_load_content_type($ctype_id);
    $pagetitle = t($ctype->name);
  }
  // Hardcode my special types for now
  if ($pagetitle == 'News') {
    $query = "SELECT nid, type FROM {node} WHERE status = 1 AND type = '" . 
        arg(1) . "' " . 'ORDER BY sticky desc,created DESC';
  } else {
    $query = "SELECT n.nid, type, td.name FROM {node} n ".
        "INNER JOIN {term_node} tn ON n.nid=tn.nid ".
        "INNER JOIN {term_data} td ON tn.tid=td.tid and td.vid=3 ".
        "WHERE status = 1 AND type = '" . 
        arg(1) . "' " . 'ORDER BY td.name, n.title';
  }
  $result = pager_query($query, 
    variable_get('default_nodes_main', 10));

  $output = '';
  $last_category = '';
  while ($node = db_fetch_object($result)) {
    if ($node->name != $last_category) {
      $output .= "<hr />\n<h2 class='dir-heading'>$node->name</h2>\n";
      $last_category = $node->name;
    }
    $output .= node_view(node_load(array('nid' => $node->nid, 'type' => $node->type)), 1);
  }
  
  $output .= theme('pager', NULL, 10);

  print theme('page', $output, t($pagetitle));
}

Mike
Fenway Views

divrom’s picture

Good work, Mike.

I'm a real newbie, so can you tell if I'm getting this wrong?

You've got a flexinode (10), which is all your diretory entries? Or does each section (e.g. Art supplies), have it's own flexinode?

Is "Johnson Artist Materials" the title, or is Art Supplies the title?

Thanks for any light you can shed.

Merlin Senger’s picture

Hi,

I would like the table view of flexinode to be sorted by the date, the node was added. I know I could do this with a custom date field, but this would be visible (also changeble) to the user (at least I think so). Can anybody give me a hint on how to do that? Thanks in advance.

g2010a’s picture

Someone here might be interested in this: http://www.kryogenix.org/code/browser/sorttable/
It allows sorting of information already retrieved from the database... it's not applicable to all situations, but it might be of some interest.

irwin’s picture

Bump, looking for exactly this, as well - being able to sort a Flexinode Table field by the date the node was published. I haven't dug into Drupal code, but I don't like modifying the core because that makes the site more difficult to upgrade.

When I get some time (hahah!) I'll look into it but it would be nice to see this in the wishlist for Flexinode.

-- Irwin
* Drupal at work -> http://suikoden.mine.nu (Suikoden-themed Role-playing Game.)
* My other Drupal site -> http://scrapped.mine.nu (Video-game & Anime-themed Blog)

Pxtl’s picture

except I'm looking to sort by the date the node was revised/edited/created. I want users to be able to update their nodes and other users see that node X was updated by it appearing at the top of the page.

The problem is that I also want this functionality when viewing by taxonomy.

Is there any way to link to other nodes in Flexinode? Any way for a node to steal the comments from a previous node? I'm trying to find a good way to do updates on nodes, but most users are just creating a whole new node to get to the top of the page. I wouldn't mind that if there was a way to link back.

fishingshrimp’s picture

first: this is not what it should be - "drupal-style". hacking the core is no real solution on long terms imho.

In taxonomy.module go to function taxonomy_select_nodes (about line 850) and find $joins .= ' INNER JOIN {term_node} tn'. $index .' ON n.nid = tn'. $index .'.nid';.

i added $joins .= ' INNER JOIN {flexinode_data} flex ON n.nid = flex.nid '; afterwards (next line) and changed the sql = ... some lines below to $sql = 'SELECT n.* FROM {node} n '. $joins .' WHERE n.status = 1 and flex.field_id = 22 '. $wheres .' ORDER BY flex.textual_data ASC';. replace flex.field_id with the id of the field you want to sort the node-listings for the taxonomy category.

i'm still looking for a way to do this without changing the core.

any ideas on this?

stevryn’s picture

I am looking to use the tabular view for a flexinode content type I created, however I want to limit what is shown. My goal would be to have a dropdown, with the users names, then you could select which users post you want to see.

Im using this as sort of a "to-do" list for people. I created flexinode content type called todos. Now I want to give people the ability for people to view our public todo's and comment on them if necessary, but with 100+ people, limiting the view would be handy. Any ideas?

9802008’s picture

?q=flexinode/table/n shows a list of flexinodes in a table, where n is the flexinode number.

Goto admin->content->content types and edit the fields in your flexinode to decide which fields show up in the table view.

www.johnstonwebsolutions.com/we_install_modify_and_maintain_drupal_web_s...