sort web apps items by date with liquid


hello

i try sort web-apps-items in column date - newst first oldest last.

but doesn’t works. output terrible unsorted.

 

this code.

 

{module_webapps id="zeittafel" filter="all" sorttype="date" collection="zeitlist" template=""}

 

{% item in zeitlist.items -%}

<div>

<h3><a href="{{item.['urlwithhost']}}">{{item.['milestone'] | date:"mmmm yy"}}</a></h3>

</div>

{% endfor -%}

 

 

it shouldn’t big fish - or?

thanks helping.

well, based on see:

 

when call:

{module_webapps id="zeittafel" filter="all" sorttype="date" collection="zeitlist" template=""}

 

you calling zeittafel sort release date. cannot sort milestone way, because according argument web app sorted. need apply javascript/jquery solve issue.

 

 

make sure add date attribute following:

 

<h3><a href="{{item.['urlwithhost']}}" data-date="{{item.['milestone']}}"  >{{item.['milestone'] | date:"mmmm yy"}}</a></h3>

 

  <script>

            $("h3 a").sort(function(a, b) {

                return new date($(a).attr("data-date")) < new date($(b).attr("data-date"));

            }).each(function() {

                $("#whereever").prepend(this);

            })

           </script>



More discussions in Business Catalyst


adobe

Comments

Popular posts from this blog

Soustraire une selection

After Effects: could not find dvaeve_dialogs.txt

Illustrator cs6 "Invalid Serial Number"