How to order nodes with a number like 1.1.1 I have a long list of files to be downloaded with different categories.

So I created a node for each file.

And assigned a term field for the categories

A file can be used in different categories so I cant sort by posted date or the order might be wrong.

Is it possible to create a text field on nodes and then order them in a view based on that number? Example


1.1.1
1.1.2
2.1.1
2.1.2


Views Natural Sort might work for this but I can only get it working on titles.
You can do this with hook_views_query_alter(). I had a similar requirement few time ago where i have to sort nodes where title those have numbers should display before the nodes those have alphabets. 
Here is a snippet i created at dropbucket.rog

http://dropbucket.org/node/1484

Steps:


Add one new text field to the content type you using for files. use textfield because integer or float type field will not allow you value in format 1.1.1.
Create a view.
Add a sort criteria the field you added either desc or asc. because you are going to alter this in hook_views_query_alter(). 


I tried with textfield name "sort". Change the field name whatever you use in content type, in query alter. You can get field name in view query display if query display is enabled in views settings.

Create a custom module.

function custom_views_query_alter(&amp;$view, &amp;$query) {
  if($view-&gt;name == 'your_view_name'){
      // Remove all the sort order fields.
      $query-&gt;orderby = array();
      // Show number before the alphabets in titles.
      // This is trick which add 0 to the field to cast it to number then check the not equal to condition.
      $query-&gt;orderby['0']['field'] = 'field_data_field_sort_field_sort_value+0&lt;&gt;0';
      $query-&gt;orderby['0']['direction'] = 'DESC';
      $query-&gt;orderby['1']['field'] = 'field_data_field_sort_field_sort_value';
      $query-&gt;orderby['1']['direction'] = 'ASC';
  }
}