Forums / Developer / sort_by path_string with strange results

sort_by path_string with strange results

Author Message

Philipp Groszmann

Monday 18 January 2010 9:22:10 am

I have a fetch

{def $entries = fetch('content', 'list', hash(
'parent_node_id', $node.node_id,
'class_filter_type', 'include',
'class_filter_array', array(64),
'sort_by', array(array('path_string', true()))
))}

which brings the correct items in a strange, not comprehensible order. It's partly correct, but partly strange.

The aim is to get a list sorted alphabetically without the problems while sorting by name with special chars.

Any ideas?

cheers
Philipp

Damien MARTIN

Tuesday 19 January 2010 2:41:44 am

Hi Philipp,

It looks like you have a mistake in your syntaxe :

{def $entries = fetch('content', 'list', hash(

 'parent_node_id', $node.node_id,

 'class_filter_type', 'include',

 'class_filter_array', array(64),

 'sort_by', array(array('path_string', true()))
))}

But it should be

{def $entries = fetch('content', 'list', hash(

 'parent_node_id', $node.node_id,

 'class_filter_type', 'include',

 'class_filter_array', array(64),

 'sort_by', array('path_string', true())
))}

You have two arrays for your sort_by.