Forum

Thread tagged as: Question

Sort by two options

Hi All

I have a list of data sorted by Launch_Date

perch_content_custom('Launch Details', array(
         'template' => '_launch_details_list.html',
         'sort' => 'launch_date',
         'sort-order'=>'DESC',
         'paginate' => 'true',
         'count'=>15,
         'filter'=> $filters,
));

however this causes a issue if there is two launches on one day

how can i order by Launch_Date and Launch_Time

Thanks

Ant

Anthony Elleray

Anthony Elleray 2 points

  • 5 years ago

Hi,

You could make a composite field, and sort on that.

Composite Fields

if i made a composite field with they still work individually as dont want to break current code ?

Yes I am pretty sure they will, but worth testing before deploying!