PDA

View Full Version : Sorting based on a custom field


imagis
05-12-2007, 07:20 AM
Hello,

I added a new field to a eSynd installation, will be a combobox on page when links are added.

Now, i got a question. How can i sort links based on that field ? I know is custom coding just want some guidance.

Sergey Ten
05-14-2007, 06:09 AM
Hello imagis,

[ Open your includes/classes/DirCategory.php ]
[ Find function "getLinks" ]
[ In the function ]


$order = 'alphabetic' == $this->mConfig['links_sorting'] ? 'title' : $this->mConfig['links_sorting'];


[ Replace with ]


$order = 'your_field_name';


[ Save change ]

imagis
05-14-2007, 10:37 AM
Thanks.

Will create a combo for field values and then sort based on on that field following your tips.

Sergey Ten
05-15-2007, 06:50 AM
Ok imagis, in any case please post a result.