Answers.Body: <p>I went and looked at the <a href="http://buildwithcraft.com/docs/templating/matrixblockmodel" rel="nofollow">MatrixBlockModel</a>; there's an attribute named <a href="http://buildwithcraft.com/docs/templating/matrixblockmodel#sortOrder" rel="nofollow">sortOrder</a> (If you output <code>{{sortOrder}}</code> inside the <code>for</code> loop, it will display the index of that block).</p>
  
  <p>You can use that attribute to sort by, in reverse:</p>
  
  <pre><code>{% for cta in entry.ctas.order('sortOrder desc') %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-28T12:44:29.603Z
Answers.LastActivityDate: 2014-10-28T12:44:29.603Z
Answers.UserDisplayName: darylknight
Body: <p>I've using a matrix field from the same entry in two different templates. In one template I want them in the order they're displaying in the CMS, while in the other I want them displayed in reverse.</p>
  
  <p>It doesn't like this:</p>
  
  <pre><code>{% for cta in entry.ctas.order('desc') %}
  </code></pre>
  
  <p>Can this be done any other way?</p>
  
Tags: <matrix><sorting><order>
Title: How to order matrix blocks in reverse
ThreadText: # How to order matrix blocks in reverse
  
  (Asked by: username_0 on 2014-10-28)
  
  I've using a matrix field from the same entry in two different templates. In one template I want them in the order they're displaying in the CMS, while in the other I want them displayed in reverse.
  
  It doesn't like this:
  
  ```
  {% for cta in entry.ctas.order('desc') %}
  
  ```
  
  Can this be done any other way?
  
  **Tags:** matrix, sorting, order
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-10-28. Score: 3 | Accepted answer
  
  I went and looked at the [MatrixBlockModel](http://buildwithcraft.com/docs/templating/matrixblockmodel); there's an attribute named [sortOrder](http://buildwithcraft.com/docs/templating/matrixblockmodel#sortOrder) (If you output `{{sortOrder}}` inside the `for` loop, it will display the index of that block).
  
  You can use that attribute to sort by, in reverse:
  
  ```
  {% for cta in entry.ctas.order('sortOrder desc') %}
  
  ```
  
  
  ---
  
  