tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/676-sorting-pagesCascade CMS: Discussion 2018-10-18T20:36:44Ztag:help-archives.hannonhill.com,2010-02-09:Comment/244053812013-01-30T21:11:50Z2013-01-30T21:11:50Zsorting pages<div><p>Attached is a script written for us early-on by HH staff. It
works well save for one thing.<br>
Our news archive is set up by a folders for years/folders for
months/news-article pages.</p>
<p>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.</p></div>steelejtag:help-archives.hannonhill.com,2010-02-09:Comment/244053812013-01-31T14:37:58Z2013-01-31T14:37:58Zsorting pages<div><p>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).</p></div>Eric L. Eppstag:help-archives.hannonhill.com,2010-02-09:Comment/244053812013-01-31T15:07:16Z2013-01-31T15:07:16Zsorting pages<div><p>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.</p></div>steelejtag:help-archives.hannonhill.com,2010-02-09:Comment/244053812013-01-31T15:37:44Z2013-01-31T15:38:23Zsorting pages<div><p>Try adding<br></p>
<pre>
<code>$_SortTool.addSortCriterion("start-date", "", "number", "ascending", "upper-first")
$_SortTool.sort($newsArticles)</code>
</pre>
before<br>
<pre>
<code>#foreach ($newsArticle in $newsArticles)</code>
</pre>
<p>(from the current script)</p></div>Eric L. Eppstag:help-archives.hannonhill.com,2010-02-09:Comment/244053812013-01-31T16:30:26Z2013-01-31T16:30:26Zsorting pages<div><p>Thanks,<br>
I thought I had tried that solution myself but must have had my
syntax wrong. We're in business now.</p>
<p>Jim</p></div>steelej