
acaul at rand
Feb 6, 2009, 8:44 AM
Post #1 of 2
(627 views)
Permalink
|
|
Schwartzian transform sorting on a subelement field
|
|
I am trying to use a Schwartzian transform to sort a bunch of stories on a field that is within a subelement. Here is my code my @related_stories = map { $_->[0] } sort { $b->[1] <=> $a->[1] } map { [ $_, $_->get_element->get_container("subelement")->get_data ('subelement_date') => $_ ] } $story->list({ element_key_name => "my_element", subelement_key_name => "subelement", category_uri => $burner->get_cat->get_uri, publish_status => 1 }); foreach my $rs (@related_stories) { $burner->display_element($rs->get_container("subelement")); } # end foreach This all works except for the sorting. The subelements display properly but are not sorted according to the subelement_date field. I think I'm a little off with my mapping, but I don't know it well enough to see where. Can anyone see it? Thanks. __________________________________________________________________________ This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
|