Please read and follow the COMMON ISSUES first!
Always add your version information in every new post! Thank you!

Form2Content Forum

Questions and answers for Form2Content, a Joomla CCK.
  1. Futuron
  2. F2C Search filtered article lists
  3. Wednesday, 02 November 2016
  4.  Subscribe via email
Hello Julien,

Where is the second ordering based on when using custom ordering? Lets say I want to order on field Date. What happens when I have two articles with the same value? Where can I change this second order value?

Regards,
Rob

J3.6.4
F2C Pro 6.14.0
F2C Search 6.5.0
Accepted Answer
Accepted Answer Pending Moderation
Hi Rob,

I think I know what you mean now....

Yes, when using the default sorting, only one field can be specified.
But on line #260 of the file components/com_form2contentsearch/models/searchbase.php the sortfield is automatically extendend with a.created DESC

This is hard coded. So when your own sort field is title ascending, it will effectively become ORDER BY title ASC,
created DESC

If you want to change this, you can modify line #260 of the file.

best,
Julien
Responses (4)
Accepted Answer Pending Moderation
Hi Rob,

In the custom sorting options, you can specifiy more than one field like this:

created;ASC;Aangemaakt;DATE
modified;ASC;Gewijzigd;DATE

Effectively this means that first the sort is done by created and then by modified.
When you compare it to SQL, it's equivalent to ORDER BY created, modified

When there are article that have the exact same values for created and modified, the result is unpredictable.

Does this answer your question?

best,
Julien
Accepted Answer Pending Moderation
Hi Julien,

Tanks for your reply but I think this is not correct. When entering values in the Custom ordering options this will generate links in the top of your view which give the visitor different options for ordering. It does not affect the default ordering and therefore you can not adjust the secondary ordering with this method.

When using a Custom ordering default there is a secondary ordering though, it just is not clear where it is defined. So when ordering on a date field, it is not clear to me what the secondary ordering does if the dates are the same.

For some reason there seems to be a ordering newest first when the dates are the same. The question here is, where is this set? Can I adjust that secondary ordering, and if so can I also set a secondary ordering based on F2C fields.

It would be very handy if there was a possibility to ad a secondary ordering in the default ordering field (just like you advised), but that does not seems to be possible at the moment. If this will never be possible it would be nice to know where to change the secondary ordering.

Greets,
Rob
Accepted Answer Pending Moderation
Hello Julien,

That is exactly what I was looking for.

A suggestion for the future might be to create a secondary order option for the default custom ordering. For now I can mange it via your solution.

Thanks a lot!
Greets,
Rob
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.