Skip Navigation

[Resolved] Relationships necessary to pull correct data for display.

This support ticket is created 6 years, 3 months 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 30 replies, has 2 voices.

Last updated by lanceG-3 6 years, 1 month ago.

Assisted by: Waqar.

Author
Posts
#1150808
ContractorDirectory.jpeg

Tell us what you are trying to do?

I'm trying to create a static listing that will display single line Bus Name, (since Start Year), Address (Street, City, Zip Code), Phone & Email within a Service name. The idea is to have a service and county selector at the top of each page, then list those relevant businesses (as mentioned above), based on the selection, and if no selection is made of service all services for that county would display and visa versa.

I've considered using County pages (10 counties) and/ or Service pages (26 services). And allow for frontend entry of these by the business owner. Our field set is more in-depth than what we will be displaying, for future growth. For now we are trying to create a simple listing of the businesses, hopefully with a Service Title above, and listings below

Is there any documentation that you are following?

I've skimmed through many of the docs online here, but feel like I'm missing something.

Is there a similar example that we can see?

I'll upload a picture similar to our idea... Imagine the "Drywall" title being duplicated with the other services down the page.

What is the link to your site?

hidden link

#1151112

Hi Lance,

Thank you for contacting us and I'll be happy to assist.

Based on what you've shared, I'll suggest the following steps to create a relationship between listings, services, and counties:

1. For listings, you can use a custom post type, where each post will hold information about each listing.
( ref: https://toolset.com/documentation/getting-started-with-toolset/structure-your-data-with-custom-post-types-fields-and-taxonomies/#create-custom-post-types-from-the-toolset-dashboard )

2. For Services and Counties, you can register two new custom taxonomies and attach them to the custom post type for the listings.
( ref: https://toolset.com/documentation/user-guides/create-custom-taxonomies/ )

3. As a result, while adding or editing each listing you'll have the option to assign specific service and county to it.

4. On the front-end, you'll be able to show only the relevant listings, based on the selected criteria through the search form, using the Toolset Views plugin:
https://toolset.com/documentation/user-guides/front-page-filters/

I hope these points will help and let me know if you have any further questions around these.

regards,
Waqar

#1151386

So that I am clear, you are suggesting I separate out the currently included Counties and Services from Listings into their own custom post types? When creating Listings I added everything I thought I needed and hence included the two selectables in there as well.

Lance

#1151876

Hi Lance,

Thanks for writing back.

You won't need separate custom post types for Counties and Services and you can just register two new custom taxonomies for segmenting your listings based on the county they belong to and their service category.

This arrangement will be very similar to how out-of-of-the-box, WordPress comes with a default post type "Posts" and we can attach different "categories" and "tags" to these posts, to categorize or segment them.

I hope this example will make this more clear.

regards,
Waqar

#1153754

So I took your advice and the displayed results are working, however I need to add a sort function to order my test data by the "service" (title/label) which is a taxonomy, first then by a types field "business-name."

So that when neither Services or county is selected the list will display all listings first sorted by Service, the by Business name to have an orderly list.

Additionally there seems to be some random text shown at the bottom of my display (ipsum) that I cannot find to edit out. Can you provide some further wisdom in that regard?

Example Link: hidden link

Thanks,

Lance

#1153756

I figured out the sorting issue, but wonder how to now show multiples in the same "service" as a list without the service title, example page listed above shows multiple Candy/Sweets entries...

Thanks,

Lance

#1154488

Hi Lance,

Thanks for the update and glad you've figured out the sorting.

If you'd like to show your listings, grouped by similar services on a page, you'll need to create two views:

1. First, you'll create a taxonomy view that lists or cycles through all the taxonomy terms in the "Services" taxonomy. This will act as a parent view.

2. Next, you'll create a post type view that will list all listings which are attached to a specific taxonomy term for services. In this view's query filter settings, you'll add the taxonomy filter for the services, selecting the option "Set by the parent Taxonomy View".
( example screenshot: hidden link )

3. After that, you'll nest this newly created post type view inside the taxonomy view created in step 1, by including its shortcode inside the "Loop Editor" section.
( example screenshot: hidden link )

4. As the last step, you can add the shortcode for your parent taxonomy view in the page where you'd like to show this grouped list.

Note: this kind of grouping can be added to a new page, but not to your existing view which has search filters for example:
hidden link

This is because front-end search filters can be added to views that list post types, but not for taxonomy views.

The "Lorem ipsum dolor" text seems to be coming from the "Elementor" plugin's widget added at the bottom of the page's content. Please open the page's edit screen and check the last row in the Elementor plugin's visual editor.

Note: As per our support policy, only one question or issue can be addressed in a single ticket.
( https://toolset.com/toolset-support-policy/ )

In the future, please open a new ticket for each new question or concern, to ensure efficient and timely assistance.

regards,
Waqar

#1158157

So I created the second view and it somehow ate my first, I'm not sure how but I think it has something to do with how the templates take over this and all pages... How do I get back to at least what I had? I feel as though I may need more reading material to truly understand how each of the components effects the other. Ideally, I'd prefer to have the two views so that I can continue testing each until I get the results I'm seeking...

Primary example link remains: hidden link
The second example is: hidden link

Thanks,

Lance

#1158760

Hi Lance,

Thanks for writing back and sorry to learn about the difficulty you're having.

From the front-end links, it is not clear how the views are configured. Can you please share temporary admin login details in reply to this message, so that I can log in to the admin area?

Your next reply will be private, which means only you and our support team will have access to it.

Important note: Please make a complete backup copy of your website, before sharing the access details.

To quickly recover the working website and restore it to an earlier date, you can consult your hosting support team, to see if they support this feature.

To avoid a situation like this in future, you can make a duplicate of your views (or other content items) and make changes to the duplicates and keep the originals, intact.
( screenshot: hidden link )

regards,
Waqar

#1160180

I provided the requested info, any update or recommendations?

Lance

#1160503

Hi Lance,

Thank you for sharing the login details and I apologize for not able to follow up on this sooner.

Unfortunately, the password that you shared isn't being accepted.

Can you please check the username and password again and share it in reply to this message?
(your next reply will be private as well)

regards,
Waqar

#1163222

I was able to backtrack and clean things up (hidden link works again).

I created a third test page:
hidden link - This get's me closer to my display goal.

It currently shows the taxonomy - 'Services' (that have dummy data in them appropriately, yet when I get to the loop it shows all dummy data in each 'Service.'

My desired output would be to only have the appropriate listing for that service (example)

Candy/Sweets

Pamela's Island Sweet Treats (since 2016) PO Box 12312, LaHaina, HI 96761 808-667-9089 pamela@islandsweettreats.com
Carrie's Cotton Candy (since 1999) PO Box 12312, San Bernardino, CA 92346 714-555-7788 web@creativetalantz.com

After I get that far, I will push forward to break the display out by each 'County' as their own pages.

Not sure which info didn't work try admin in lowercase.

Lance

#1165536

Hi Lance,

Glad you were able to make some progress.

Unfortunately, the username seems to be correct but the password that you shared isn't being accepted.

I'm setting you next reply as private as well and would recommend to generate the password for that user and share it again.

Once I'm logged in and have seen the view's settings, I'll be in a better position to suggest the appropriate settings.

regards,
Waqar

#1166170

Hi Lance,

Unfortunately, the new password that you shared in also not being accepted and showing "ERROR: The password you entered for the username is incorrect" message:

Can you please check the password again?

Your next reply will be private too.

regards,
Waqar

#1168381

If you can send me your email I send it directly from WP as a link...

Lance