Skip Navigation

[Resolved] Therapist Listing Website

This support ticket is created 4 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
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: Africa/Casablanca (GMT+01:00)

This topic contains 14 replies, has 2 voices.

Last updated by Jamal 4 years ago.

Assisted by: Jamal.

Author
Posts
#2148841
toolset.png

Hello there,

I'm currently migrating a website from Elementor to Gutenberg and thought Toolset would be the right tool for doing the dynamic content.
Under Elementor I worked with JetEngine to achive that and it was pretty easy to do, on gutenberg I might need a heads up.

First of all, here is what I want to achive:

The website is about mental help and therefore it has a listing for therapists for different states in the USA.

The flow would go like this:

Frontpage -> Click on menu link "find a therapist" -> then there is a listing of the states -> click on a state -> Listing of therapists.
It is very similar to the talkspace website: hidden link

Here is what I did already:

- Create a new Post Type named: Therapists
- Create Custom fields with the infos needed (such as name, image, biography, working states, years in practice and so on)
- Create a taxonomy named "States" (because this will be filter) associated to "Therapists"
- Fill in Therapists data

Now I'm stuck on what to do next.

Under Elementor I did the following:

- Create a listing loop and design it
- Under Theme Builder I created a custom "Archive" page with the condition: States -> All, then design the page accordingly with the dynamic data (see screenshot)

What is the right approach for Toolset and Gutenberg?

Thank you very much!

#2148851

Forgot to add, that I am using the Kadence Pro Theme and Pro Blocks.

#2148925

Hello and thank you for contacting Toolset support.

I believe all of the above can be implemented using Toolset Blocks and other compatible blocks plugins https://toolset.com/documentation/dynamic-sources-in-popular-blocks/

However, it might be difficult or even no possibility to get the same structure for the URLs. (ex: hidden link for Washington) because WordPress enforces each own URL structure.
It can be customized further using 3rd party plugins or custom code. However, that's out of the scope of the support forum.

Regarding how to pull the dynamic data in the blocks editor, please check the 3rd chapter on this tutorial https://toolset.com/course-chapter/displaying-content-types/
You may found the following articles interesting too https://toolset.com/related-lesson/designing/

I hope this helps. Let me know if you have any questions.

#2148939

Hey, thanks for the quick answer.

Thats unfortunate.

I think the only alternative would be to create a parent page (/find-a-therapist) and then a subpage for each state (/find-a-therapist/arizona, etc.) and then have a listing or view on each subpage.

I already checked the "Real estate course" on your website and already helped a lot.

I assume it is possible under elementor, because of its theme builder (basically create a page/archive for whatever page and put whatever you want on them), at least thats what I did. Create archive page and pull the data dynamically.

Thank you anways!

#2149585

Using pages is probably the best workaround. But you can also implement slightly different slugs. The idea is to use the "/therapist/" base for single therapists posts. And "/therapists/"(plural) for the post archive and the taxonomy archives.
The solution consists of:
- Making "therapist" the slug of the custom post type. Check this screenshot hidden link
- Making "therapists"(plural) the base for the custom post archive. Check this screenshot hidden link
- Making "therapists" the base for the States taxonomy's rewrite rules. Check this screenshot hidden link

This way, you will get the following URL structures:
- hidden link => the archive for the Therapists post type.
- hidden link => the single post page for the therapist "Jhon".
- hidden link => the archive for the state "Washington".

Please note, that if you want to handle cities(hidden link), you will need to make them child terms in the State taxonomy(even though they are not states).

I made an example on a test site that you can check here hidden link
- CPT archive: hidden link
- Taxonomy archive: hidden link
- Single post page: hidden link

Now, that we have archives for the post type and the taxonomies, you can build archive templates to customize how they look. Keep in mind the following limitations:
- An archive template for the taxonomy States CANNOT have a search filter for states.
- Archive templates do not support distance searches.

If you want to, always, have the states filter, you may need to use the pages workaround.
If you want to have distance search, you must use the pages workaround.

#2150583

Thanks for the explanation!

Something I have in my mind:

Would it make sense to do it the other way around?

For example:
Have a custom post type which contains the states and then have a custom taxonomy with meta fields for the therapist data and associate the therapist (taxonomy) to the state (CPT).

#2150661

I don't think so. Taxonomies are meant to be a way of categorizing or classifying posts. The main post type in this project is the "Therapists". States could be taxonomy to categorize or join together the therapists from the same state.

In addition, Toolset views do not support the search for taxonomy views. So, you won't be able to search/filter therapists.

On the other hand, you can make states and cities custom post types, and create relationships to link a state to a city, and a city to a therapist:
- 3 custom post types: Therapists, States, and Cities.
- 2 one-to-many relationships: State<>Cities, City<>Therapists.

We have a reference site that does the same hidden link and a tutorial about it https://toolset.com/course/wordpress-real-estate-sites/
I invite you to create a demo site and see how it was implemented. https://discover-wp.com/register?site_type=1288
And I highly recommend checking the tutorial. https://toolset.com/course/wordpress-real-estate-sites/

#2150697

Relationships is a good idea!

Checking out the demo right now, trying to figure it out.

Since we don't use cities (yet) we only would need 2 CPTs, correct? So basically: Therapists and States as a custom post type and then just create a on-to-many relationship between Therapists<>States.

Then from the Dashboard I can create a template for States, then inside the template create a toolset view and design it to my needs, same for Therapists (Which is Agents in the demo). Thats how its done on the demo from what I see, right?

#2150735

Yes, one relationship(State<>Therapist) would be enough.

In analogy to the demo, the therapists would be the properties, not the agents.

And yes, you are right. In the state content template, you will add a view to display the therapists from that state. And in the therapist content template, I don't think you will need any view. You can display the state directly using a Single Field block for example.

#2153503
msedge_EvVeWL7LDC.png

Alright, I went with the individual page solution.

So the current structure is this:

/find-a-therapist

Then I created a subpage for the states where /find-a-therapist is the parent page, slugs are like this:

/find-a-therapist/arizona
/find-a-therapist/new-jersey
etc.

My custom Post Type is named "Therapists" and I've created a Taxonomy named "States".

So I've created a couple of Therapists and filled in the data, now my problem is the view output.

On the Arizona page I have setup a filter (View output -> content selection) - See attachment.

Then I've cloned the Arizona page and changed everything to New Jersey, on the filter selection I choosed "New Jersey" and saved the page, the problem: The filter also changes the Arizona page to New Jersey, so therefore the Arizona page now shows New Jersey therapists.

Not sure if its because I cloned the page or if I have to setup the filter a different way, because I thought the filter would be "per page" but it seems its global?

#2153563

Well, you have cloned the page, but the view was not cloned. It was just reused in two pages. So, whenever you updated it, the update will be visible on all pages where the view is used.

What I would suggest is to change the query filter to use the state taxonomy pulled from the page where this view is shown. Check this screenshot hidden link
Then you will have to assign the term New-Jersy to the page. For that, you will need to use the taxonomy on pages too. In Toolset->Custom Taxonomies. In the end, you will be using only one view, instead of a view per page. Does it make sense?

If you are not sure how to implement it, allow me temporary access to your website and I'll prepare an example for you. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#2153689

I can't share it yet, have it to replicate it without sensitive information on it, so hopefully it can be solved this way.

Here are all the steps I did so far:

- Create Custom Post Type named: "Therapists".
- Create Custom Field Group for "Therapists" and all the Information i want to be shown on the frontend.
- Create custom Taxonomy named "States" and associated it with "Therapists" CPT, also checked the option "Hierarchical URLs".
- Added Therapists with the information in the CPT and added them to the Taxonomy (State).
- Create parent Page "Find a Therapist".
- Create subpage named "Arizona" (Parent: Find a Therapist) and added a Container Block and inside I added the "View" Block.
- In the View Block -> Content Selection I choosed "Therapists" (CPT), unchecked the option "Don't include the current page in the query result" so I can filter the Taxonomies.
- Added a filter and choosed: Taxonomies -> States and choosed the option you showed me on the screenshot (see here: hidden link)
- After the filter is applied I get an message: "There were no posts found to display for this View's query."

#2153751

I assume that you still need the following steps.

- Associate the taxonomy States to the default post type Pages. Like this hidden link
- Assign the term "Arizona" to the subpage "Arizona". Check this screenshot hidden link

You can see it on my test site here hidden link

And then you can reuse the same view on a different page, check my example for Washington here hidden link

#2154307

Yes! That did it!

Thank you.

#2154313

You are welcome! I am glad I could help.

If you think that the original request of this thread has been answered, I'll have to kindly ask you to mark this ticket as resolved.

All the best,
Jamal