Skip Navigation

[Resolved] I need a second sort option

This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 10 replies, has 3 voices.

Last updated by Beda 6 years, 12 months ago.

Assisted by: Beda.

Author
Posts
#588699
Edit_View_‹_Make_Your_Best_Move.jpg

I am trying to: Set up a second sort option for the home page featured properties ribbon. I first want all active/pending (not sold) properties to appear. The second sort should allow me to display sold properties based upon date sold.

Link to a page where the issue can be seen: hidden link

I expected to see: Under featured properties, I want all active, current, for sale properties to display first. Then I want the sold properties to display by date-sold/decending

Instead, I got: second sort displays date sold randomly, not by most recent sold date first.

#588766

Secondary Ordering in Toolset Views takes only native Post Data.
I filed a feature request to allow also ordering by Custom Fields and more, but this is not yet implemented.

Hence you need to order by Custom Fields in the first orderby setting, and then use the secondary ordering as a fallback, in case there are posts with the same value of the ordering #1.

This is what the secondary ordering is intended for.

Please note that in some cases you need to choose how to use the Fields values (native Custom Field, string or number)
This is necessary in case you have a numeric value in a string field, WordPress would mess up the ordering (they order only by string)

#589931

I appreciate your response. On the front page ribbon, in order to sort as needed, we would need to be able to sort by custom fields in first and second options. I am reading that this is not available yet. Please advise if there is an alternative way to complete the first & second sorts until the toolset is configured for sorting by custom fields. If not, please notify me when this option becomes available.

Thank you & warm regards,
Tracey Devlin

#590169
Bildschirmfoto 2017-11-16 um 07.52.04.png

I am sorry, I understood you want the backend Ordering second option to take a Custom Field, because of your ScreenShot.
That is not possible.

But, in the front end, it is.
You can just add new "Sorting Controls" in the Custom Filter Editor.
There, you can sort by as many Custom Fields you want, and that will be visible and usable in the Front End.
Please also see the Screenshot.

#590385

Thank you so much. I do not see where I can add controls for front end sorting using custom fields. Could you explain the steps, or email or I can get you access so we can get this accomplished.
Thank you so much!
Tracey

#590538

These settings are in any View that is setup to enable a Custom Search.
In the Filter Editor, you see a Button that says "Sorting Controls".
Click on it, an start to insert the Controls.

Here is also a Document elaborating the usage:
https://toolset.com/documentation/user-guides/allowing-visitors-to-sort-the-front-end-results/

#591723

Hello Beda,
We are awaiting confirmation of a solid backup of the website before I apply these changes. I will let you know (probably Friday or Saturday) when I am able to configure the sort option and if I have any difficulties.

Thank you so much!
Tracey

#592521

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello traceyD,

Beda is on vacation. This is Minesh here and I'll take care of this ticket and try to help you further. Hope this is OK.

Please let us know if you need further assistance.

#594098

Now I've really screwed it up. I need to remove the "box" that allows the user to select how to sort. Secondly, it doesn't appear to be working for secondary pages as it scrolls. Can I give you access so you can take a look and fix this for me?

The toolset view is for: Featured Properties Home Page View

Let me know where to send you some credentials.
Thank you,
Tracey

#594322

I see you have had success in inserting the Front End Sort Options, as you now mean to remove the "box" that allows the user to select how to sort.¨
I thought this is what you need to show on the Front End?

However, if you want to remove them, you can delete those Codes from the Filter Editor area.

Now, as for secondary pages on scroll, the ordering works fine also when the results are paginated.
It will first sort by, then it will paginate.
This means, when the user is re-ordering with those controls his pagination will be reset to page one, that must happen so the ordering can affect the results.

You can send me the Log In details if you think this will be useful to solve the issue.
Please share the exact URL's to the Screens you want me to look at.

I can then see to set up some example for you, or change existing settings.
I cannot debug Online Sites, however, as that does not allow to run debug tools.

So let's first see if we can solve it by changing some settings.

#595902
Sort Controls.png

We want the sort to display automatically within page scrolling. We do not want the viewer to have the "box" which allows them an option of how to sort.

In a View, the Loop and the Filter are output by 2 ShortCodes, in the "Filter and Loop Output Integration Editor":

[wpv-filter-meta-html]
[wpv-layout-meta-html]

Those 2 ShortCodes display once the Filter section and once the Loop.
This cannot be changed, only it can be customized with HTML.

When you insert the View, you can insert it all together or the Search Form at one place and the Search Results (Loop) in another place.

For example, you can have a DIV on your Template that contains the results, and a floating DIV with the Custom Search.

Anyway, how you display the View is a matter of how you insert the ShortCode and the Custom HTML you wrap it in or use in it.

I see that you have only pagination inserted in the Filter Editor.
That is where you need to insert he ShortCodes for the Sort By Controls on the Front end.
I attached a Screenshot of where to do that in your View.