sorting pages

steelej's Avatar

steelej

30 Jan, 2013 09:11 PM

Attached is a script written for us early-on by HH staff. It works well save for one thing.
Our news archive is set up by a folders for years/folders for months/news-article pages.

I noted (after receiving a question about it today) that this script sorts at the month level. The pages in the folders, though, are not sorted. I'm trying to sort the pages in each month by start-date. I haven't figured out how, as of yet. Any help would be appreciated.

  1. 1 Posted by Eric L. Epps on 31 Jan, 2013 02:37 PM

    Eric L. Epps's Avatar

    I think it's just a typo on line 5. I think that _SortTool should be sorting on $eventsArticles, not $eventsArticle (which doesn't exist yet).

  2. 2 Posted by steelej on 31 Jan, 2013 03:07 PM

    steelej's Avatar

    You're right about the typo. The other problem would be I sent the wrong script. Sorry. Attached is the current script that sorts the months successfully. Also is my attempt to order the articles--still not working.

  3. 3 Posted by Eric L. Epps on 31 Jan, 2013 03:37 PM

    Eric L. Epps's Avatar

    Try adding

    $_SortTool.addSortCriterion("start-date", "", "number", "ascending", "upper-first")
    $_SortTool.sort($newsArticles)
    
    before
    #foreach ($newsArticle in $newsArticles)
    

    (from the current script)

  4. 4 Posted by steelej on 31 Jan, 2013 04:30 PM

    steelej's Avatar

    Thanks,
    I thought I had tried that solution myself but must have had my syntax wrong. We're in business now.

    Jim

  5. Ryan Griffith closed this discussion on 31 Jan, 2013 04:39 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac