Sort Tool: last-published-on
I wrote a Velocity script to view our most recently published pages (using an index block). The report starts off as anticipated, in chronological order, but after a while the dates start going out of order. The script is attached. Did I do something wrong?
- recently-published.vm 1.01 KB
Discussions are closed to public comments.
If you need help with Cascade CMS please
start a new discussion.
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
1 Posted by Charlie Holder on Jun 25, 2011 @ 04:04 AM
Can you attach a sample of XML data that this format is processing as well as the HTML outcome you're getting as output?
2 Posted by espanae on Jun 28, 2011 @ 05:30 PM
Sure.
You'll notice the System Pages are correctly in chronological order (correctly) but then start repeating: http://union.edu/_dev8080/reports/recently-published/standard-content/
It's running against an index block (content type) which I've attached. I also attached an updated version of the Velocity script with comments.
Thanks for your help.
3 Posted by Charlie Holder on Jul 03, 2011 @ 06:26 PM
Oh man. This one was tricky to diagnose.
I don't really know why nor do I understand the implications inside Cascade, but not all of the
system-page
nodes contained in your sample XML have alast-published-on
node. I think that because the Velocity Format can't find the node to sort on with the$_SortTool
call some weird stuff is happening. I'm sorry I personally cannot offer some more concrete advice. I will bump this thread to support for an internal discussion and then maybe they can offer something more detailed.With all that said, I was able to achieve a properly sorted page by adding a filter to the initial
$_XPathTool
call. The filter only includes pages that have alast-published-on
node.I also made one (small) additional change to the Format. Instead of having the #if statement inside your #foreach loop, you can filter out the pages that belong to the "development" Site in the initial
$_XPathTool
call similar to the previous paragraph.Here's a copy of the Format I ended with. Please let me know if you have any questions.
4 Posted by espanae on Jul 05, 2011 @ 03:06 PM
Charlie, thank you for resolving the issue.
I'll keep you posted if I notice any other "weirdness" with our data.
Charlie Holder closed this discussion on Jul 26, 2011 @ 06:00 PM.