Sorting Arrays by Properties in the Template Editor for Visualizers


Originally, the arrays in the template editor for visualizers are sorted alphabetically. This article shares the process of sorting them by properties.



  1. Log into your DNN instance.
  2. Go to Content > Content Library > Visualizers > Choose a Visualizer.
  3. Open the Editor tab.
  4. Modify the following sample code as needed. In this example, the code assigns the storeLocations property to the locations variable and sorts by the contentName property.

    {% assign locations = storeLocations | sort: 'contentName' -%}
    {% for item in locations -%}
    <div class="storeLoc">
    {% endfor -%}
  5. Place the code in the Template section and save.



Please sign in to leave a comment.