How do I order list output?

I want to display a set of documents in alphabetical order and not the order they were entered into the database.  

The docs are displayed via this code:

<w:snippet name='tech-specs-list' />

Snippet:

<w:taxonomy name="doc-types:Tech Spec">
   <w:kb:item:each taxonomy="current">
      <div class="pdf_wide">     
      <w:unless condition="icon.blank?">
        <href="<w:file />"><img src="<w:icon rendition='thumb' />" ></a>
      </w:unless>
      <h2><w:name /></h2
      <p>
      <w:description />
      <href="<w:file />">View PDF</a>
      </p>
      </div>
  </w:kb:item:each>
</w:taxonomy>


Thanks for your help!

Have more questions? Submit a request

3 Comments

  • 0
    Avatar
    Christopher Haupt

    Try adding the sort attribute to the item:each iterator:

    <w:kb:item:each taxonomy="current" sort="name ASC">

    This should sort the items alphabetically by name in ASCending order.

  • 0
    Avatar
    Patrick Schutte

    Thanks, Chris...works like a charm...is there are resource of the different sort options?  I tried searching for something before asking the question, but did not come up with anything.  Thanks again!

  • 0
    Avatar
    Christopher Haupt

    This is probably a good start: http://support.webvanta.com/article/76669-accessing-database-information#ChoosingtheSortOrder. You can also sort on various custom fields. Drop us a line if you get into needing to do that.

Please sign in to leave a comment.
Powered by Zendesk