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.

week_sort not working

August 27, 2007 5:11pm

Subscribe [2]
  • #1 / Aug 27, 2007 5:11pm

    asarbogast

    14 posts

    EE 1.6, Build 20070815

    Here is the template code I am working with:

    <dl>
    {exp:weblog:entries weblog="news" display_by="week" start_day="Sunday" week_sort="desc" sort="asc" limit="100"}
    {date_heading display="weekly"}<dt>Week of: <span>{entry_date format=" %M %d, %Y"}</span></dt>{/date_heading}
    <dd><a href="http://{title_permalink=news}">{title} »</a> {if news_intro}<span class="summary">{news_intro}</span>{/if}</dd>
    {/exp:weblog:entries}
    </dl>

    From the docs for week_sort (http://expressionengine.com/docs/modules/weblog/parameters.html):

    Changes the sort order of the weeks so that you can either have the weeks displayed by most recent first or oldest first. Separate from the sort=”” parameter, which will only affect the sorting of entries within the weeks, not the weeks themselves.

    So, I would expect the code above to produce a list of weeks with the most recent week first, and within each week, have a list of articles with articles at the beginning of the week listed first.

    However, you can see the results at http://now.humboldt.edu/news/category/alumni-news/—everything is sorted ascending according the the “sort” parameter. This behavior holds up if I change the values of the parameters—weeks and articles are always sorted by the “sort” parameter, and the “week_sort” parameter has no effect.

    Am I missing something here?

  • #2 / Aug 27, 2007 5:14pm

    Lisa Wess

    20502 posts

    What version and build are you using?

  • #3 / Aug 27, 2007 5:17pm

    asarbogast

    14 posts

    EE 1.6, Build 20070815

  • #4 / Aug 28, 2007 11:21am

    Robin Sowell

    13255 posts

    We’re replicating this one, asarbogast.  We’ll dig deeper and let you know what we find.

  • #5 / Aug 28, 2007 1:22pm

    asarbogast

    14 posts

    Great, thanks!

  • #6 / Sep 06, 2007 2:26pm

    Lisa Wess

    20502 posts

    Just as a note, this is now in our bug tracker..

  • #7 / Dec 02, 2007 1:00am

    Stephen Slater

    366 posts

    I notice this issue has been resolved in the Bug Tracker, but I’m experiencing the exact same problem with ExpressionEngine 1.6.1 - Build:  20071114.

    Could it be possible that the bug could reappear in 1.6.1?

  • #8 / Dec 02, 2007 11:19am

    Robin Sowell

    13255 posts

    It looks like it’s working for me on the latest build- and the query looks like I’d expect it to:

    SELECT DATE_FORMAT(FROM_UNIXTIME(entry_date + -18000), '%X%V') AS yearweek , etc….
    ORDER BY yearweek DESC, t.sticky desc, t.entry_date asc

    Can you create a test page- just put some sample code on it a la

    <dl>
    {exp:weblog:entries weblog="reading" display_by="week" start_day="Sunday" week_sort="desc" sort="asc" limit="100"}
    {date_heading display="weekly"}<dt>Week of: <span>{entry_date format=" %M %d, %Y"}</span></dt>{/date_heading}
    <dd><a href="http://{title_permalink=news}">{title} »</a>  - {entry_date format=" %M %d, %Y : %g:%i:%s"}</dd>
    {/exp:weblog:entries}
    </dl>

    Try flipping out the sort- does it change- and if it’s definitely not working, can you link to the test page in action?

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

ExpressionEngine News!

#eecms, #events, #releases