title: Adding weight fields to bundles in drupal
body: <p>Now, i'm not quite sure on the vocabulary around entities and bundles, so apologies, but here's my problem.</p>
  
  <p>I've got lots of content types, and in a view i want to sort nodes first by content type, and then by date</p>
  
  <p>But there is no value on which to sort that makes sense - i want to sort content types into an bespoke order 'Clothes, animals, drinks, people'  - i.e. not alphabetical.</p>
  
  <p>I have tried using global php to sort these into a bespoke order - it works fine. 
  i.e. </p>
  
  <pre><code>$myarray=array("films","shoes","people","animals");
  </code></pre>
  
  <p>This is the set up code and then for every row, views php allows you to sort thusly:</p>
  
  <pre><code>$pos1=array_search($row1-&gt;type, $myarray);
  $pos2=array_search($row2-&gt;type, $myarray);
  return $pos1-$pos2;
  </code></pre>
  
  <p>It works, but I can't combine it with the date sort, and anyway the overhead must be pretty bad.</p>
  
  <p>So, my question is, is there a way that I can add a weighting field to the content types, at what I think might be the bundle level (!?) to allow me to sort my data in views by content type, in a bespoke order (non-alphabetical).</p>
  
  <p>Phew. Any help appreciated.</p>