ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

list by expiry date, soonest at top

February 08, 2011 12:37pm

Subscribe [3]
  • #1 / Feb 08, 2011 12:37pm

    furryfrog

    17 posts

    hi there, i am trying to list my blog entries by expiry date, but with the soonest at the top.

    At present, the list is upside down with the soonest at the bottom?

    kind regards

    neil
         
    the code i am using is as follows.

    {exp:weblog:entries weblog="Blackfield_Live_Dates" show_expired="yes" orderby="expiration_date" }
    
    <table class="dates">
        <tr{if expiration_date != "0" && "{expiration_date format='%U'}" < "{current_time format='%U'}"}
     class="expiredgig"{/if}>
  • #2 / Feb 08, 2011 2:25pm

    Kevin Cupp

    791 posts

    Try adding sort=“asc” to your {exp:weblog:entries} tag.

  • #3 / Feb 08, 2011 3:05pm

    furryfrog

    17 posts

    thanks kevin, but that didnt work

  • #4 / Feb 08, 2011 11:49pm

    John Henry Donovan

    12339 posts

    neil,

    I just tried using the following set-up and it sorted ok for me. Can you try and simplify it like I have done? Did you copy and paste the parameter from Kevin’s response by any chance?

    <ul>
    {exp:weblog:entries weblog="Blackfield_Live_Dates" show_expired="yes" orderby="expiration_date" sort="asc"}
    <li>{title} - {expiration_date format="%Y %m %d"}</li>
    {/exp:weblog:entries}
    </ul>
  • #5 / Feb 11, 2011 5:23am

    furryfrog

    17 posts

    thankyou john, that worked a treat

  • #6 / Feb 11, 2011 7:41am

    Ingmar

    29245 posts

    Very glad to her it. Please don’t hesitate to post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases