Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
- This topic has 2 replies, 2 voices, and was last updated 10 years, 7 months ago by
George Socha.
-
AuthorPosts
-
01/11/2016 at 5:47 pm #360769
George Socha
ParticipantSteve,
When using
order_by, I get results that are not what I expected.If I use
[connections template="cmap" order_by="organization"...,the first four entries returned are “17a-4”, “2nd Chair Services”, “7Safe” and “911 Forensic Data”.If I use
[connections template="cmap" order_by="organization,state"..., the first four entries returned are “17a-4”, “AccessData”, “Advanced Discovery” and “Avansic”.I would expect to get the results either way.
The difference, I think, is that no addresses have been entered for “2nd Chair Services”, “7Safe” and “911 Forensic Data”.
Neither approach accomplishes what I was hoping to do, which was to have addresses be ordered by state on the
card-single.phpview, and maybe this is howorder_byis supposed to work, but I thought you would want to know.01/11/2016 at 9:26 pm #360780Steven Zahm
Keymaster@ George
re: I would expect to get the results either way.
I do not quite get what you mean to say? Could you explain further?
re: When using order_by, I get results that are not what I expected.
I double checked the query being sent to the db, it is correct.
re: If I use
[connections template="cmap" order_by="organization"...,the first four entries returned are “17a-4”, “2nd Chair Services”, “7Safe” and “911 Forensic Data”.That looks correct.
re: If I use
[connections template="cmap" order_by="organization,state"..., the first four entries returned are “17a-4”, “AccessData”, “Advanced Discovery” and “Avansic”. The difference, I think, is that no addresses have been entered for “2nd Chair Services”, “7Safe” and “911 Forensic Data”.I believe the db will “discard” records or maybe “prioritizes” the records in which there is data available. I’d have to look that up. But, if it is the former, then those entries simply would not be displayed as results. If it is the later, then the entries without the data (state) would be last in the results. Either way, the solution is to make sure the entries which you want to sort have data to sort by.
Ohhh… I just thought of another third possibility. When the query is made to the db, it has to join the main data table with the address table. This joining is based on the entry ID. So, only entries with addresses will be returned as results and only those will be sorted. Anyway, the solution is the same, if you are going to sort by it, you need to have data in the field that your are sorting by.
Hope that helps!
01/12/2016 at 7:52 am #360810George Socha
ParticipantSteve,
Here is a more detailed explanation, with an attached spreadsheet to help illustrate what I mean.
Assume entries for five organizations. Four orgs have addresses which include states. One org has two addresses which include states. One org does not have any addresses. The entries look like this:
Org A State A Org B State B, State A Org D State C Org C Org E State BIf ordered by Org only, the list should look like thise:
Org A State A Org B State B, State A Org C Org D State C Org E State BI would expect that if ordered by Org and then State, the list would look like this, which is what Excel does:
Org A State A Org B State A, State B Org C Org D State C Org E State BInstead, when ordered by Org and then State, the results are something like this, with the one Org that has no State at the end so that Org C comes after Org E even though C comes before B in the alphabet:
Org A State A Org B State A, State B Org D State C Org E State B Org CI hope this explains better what I meant.
George
Attachments:
You must be logged in to view attached files. -
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
