Forums/How Do I ... ?

How do I order list output?

Patrick Schutte
posted this on July 13, 2011, 16:24

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!

 

Comments

User photo
Christopher Haupt
Webvanta

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.

July 13, 2011, 16:33
User photo
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!

July 14, 2011, 08:55
User photo
Christopher Haupt
Webvanta

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

July 14, 2011, 10:24