Answers.Body: <p><code>fixedOrder</code> only works with the <code>id</code> param. (If <code>fixedOrder</code> is <code>true</code> <em>and</em> <code>id</code> is set to a list of IDs, it will return the elements in the exact order that the IDs were listed.) It’s currently not possible to query elements in a fixed order based on any other params.</p>
  
  <p>For your use case, the <a href="https://craftcms.com/docs/templating/filters#group" rel="nofollow">|group</a> filter should work nicely:</p>
  
  <pre><code>{% set kinds = ['pdf', 'word', 'excel'] %}
  {% set filesByKind = craft.assets.kind(kinds)|group('kind') %}
  
  &lt;section class="bestanden"&gt;
      &lt;div class="col-12-md"&gt;
          &lt;div class="documenten"&gt;
              &lt;ul&gt;
                  {# Loop through the file kinds in the order we want #}
                  {% for kind in kinds %}
                      {% for file in filesByKind[kind] %}
                          &lt;li&gt;
                             &lt;i class="fa fa-file-{{ kind }}-o"&gt;&lt;/i&gt; &lt;a href="{{ file.url }}" target="_blank"&gt;{{ file }}&lt;/a&gt;
                          &lt;/li&gt;
                      {% endfor %}
                  {% endfor %}
              &lt;/ul&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/section&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-18T16:41:04.613Z
Answers.LastActivityDate: 2016-10-18T16:41:04.613Z
Answers.UserDisplayName: Brandon Kelly
Body: <p>I thought that a simple <code>.fixedOrder(true)</code> would make the files order in the same way as in the CMS. Instead of that, there is no output. Where I go wrong?</p>
  
  <pre><code>{% set files = craft.assets.kind('pdf,word,excel').fixedOrder(true) %}
  &lt;section class="bestanden"&gt;
      &lt;div class="col-12-md"&gt;
          &lt;div class="documenten"&gt;
              &lt;ul&gt;
                  {% for file in files %}
                  &lt;li&gt;
                     &lt;i class="fa fa-file-{{ file.kind }}-o"&gt;&lt;/i&gt; &lt;a href="{{ file.url }}" target="_blank"&gt;{{ file }}&lt;/a&gt;
                  &lt;/li&gt;
                  {% endfor %}
              &lt;/ul&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/section&gt;
  </code></pre>
  
Tags: <assets>
Title: fixedOrder(true) not working?
ThreadText: # fixedOrder(true) not working?
  
  (Asked by: username_0 on 2016-10-18)
  
  I thought that a simple `.fixedOrder(true)` would make the files order in the same way as in the CMS. Instead of that, there is no output. Where I go wrong?
  
  ```
  {% set files = craft.assets.kind('pdf,word,excel').fixedOrder(true) %}
  <section class="bestanden">
      <div class="col-12-md">
          <div class="documenten">
              <ul>
                  {% for file in files %}
                  <li>
                     <i class="fa fa-file-{{ file.kind }}-o"></i> <a href="{{ file.url }}" target="_blank">{{ file }}</a>
                  </li>
                  {% endfor %}
              </ul>
  
          </div>
      </div>
  </section>
  
  ```
  
  **Tags:** assets
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-10-18. Score: 4
  
  `fixedOrder` only works with the `id` param. (If `fixedOrder` is `true` *and* `id` is set to a list of IDs, it will return the elements in the exact order that the IDs were listed.) It’s currently not possible to query elements in a fixed order based on any other params.
  
  For your use case, the [|group](https://craftcms.com/docs/templating/filters#group) filter should work nicely:
  
  ```
  {% set kinds = ['pdf', 'word', 'excel'] %}
  {% set filesByKind = craft.assets.kind(kinds)|group('kind') %}
  
  <section class="bestanden">
      <div class="col-12-md">
          <div class="documenten">
              <ul>
                  {# Loop through the file kinds in the order we want #}
                  {% for kind in kinds %}
                      {% for file in filesByKind[kind] %}
                          <li>
                             <i class="fa fa-file-{{ kind }}-o"></i> <a href="{{ file.url }}" target="_blank">{{ file }}</a>
                          </li>
                      {% endfor %}
                  {% endfor %}
              </ul>
          </div>
      </div>
  </section>
  
  ```
  
  
  ---
  
  