Skip Navigation

[Resolved] Optimizing site structure

This support ticket is created 4 years, 4 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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/Hong_Kong (GMT+08:00)

Author
Posts
#1687537

I am trying to create a website that will eventually have many interconnected tools/features. I am new to the tools that I am using to build brand new my website - WordPress, Elementor, WPML and Toolset. Since I am not very familiar with the various strengths and potential limitations, I thought I would ask for your advice on how to structure it. At the heart of the site will be a comprehensive directory that could include individuals and any type of business/institution you can think of. I am also working on a tool that will connect employers to job candidates.

So taking a restaurant, as an example, I would like to have a directory entry for this restaurant that has the same basic contact information about its business that several other businesses/institutions/organizations/etc. might have including name, description, email address, etc. The restaurant will also have special fields that only restaurants have and a local beach won't - restaurant will have a tv and a menu and a park will have rules for use. Both the restaurant (waiter) and park (lifeguard) may be hiring, however, and the same basic contact information that they entered for their directory page will be relevant for their job postings and I don't want them to have to enter this information more than once.

Another example, an individual may decide that he wants to be included in the directory with his name, home address. He may also want to be listed as a business because he does freelance electrical work. He may also not like doing freelance electrical work and want to apply for a job and need to create a candidate profile. So for all of these he may have similar contact information that should be only entered once, but for different tools/areas of the website, he may have other custom fields related to his basic person, or maybe business profile.

The people who will be accessing my website are in an area with very poor bandwidth so performance is a significant concern. I am developing the site in English and it needs to be translated into Spanish from the ground up.

I will want users to be able to search in a variety of ways. For example someone might say I'm staying in Z hotel and I want to know what's nearby - businesses, parks, beaches, restaurants, service providers, etc.

Any guidance would be highly appreciated. Thanks!

#1688379

Hi Jennifer,

Welcome to Toolset support and I'd be happy to assist.

Based on the requirements that you've shared, I can confirm that the Toolset plugins can prove very useful in developing your planned website.

It is important however that you've become familiar with important Toolset concepts and the best way to achieve this would be through our guides and tutorials available in the documentation:
https://toolset.com/documentation/

And since you'll be working on a directory and classified website, I'll especially recommend this guide:
https://toolset.com/course/wordpress-directory-and-classifieds-sites/

We also have "Learn by example" risk-free online area, where you can explore the Toolset features by working with already built demo websites:
https://discover-wp.com/

As for the structure, I'll recommend using a centralized custom post type named something like "User Profiles" to store each individual user's information, regardless of the activities that this user will be involved in.
( ref: https://toolset.com/course-chapter/setting-up-custom-post-types-fields-and-taxonomy-directory/ )

To distinguish between business or profile types, you can register a custom taxonomy named something like "Profile Type" and add terms like "restaurant", "local beach" etc so that you can categorize them as needed.
( ref: https://toolset.com/course-lesson/creating-a-custom-taxonomy/ )

Toolset Types also allows you to conditionally add custom fields to posts, so that specific field group is only available if a certain condition is met, which also includes taxonomy based conditions.
( ref: https://toolset.com/course-lesson/creating-custom-fields/#how-to-add-custom-fields-to-content )

For the distance-based search/filtering Toolset Maps plugin can be used:
https://toolset.com/course-lesson/displaying-a-list-of-posts-on-a-map/#filtering-markers-by-distance

When it comes to performance, we're constantly improving our plugins so that they can offer the best possible results, without compromising on the ease-of-use or the flexibility.

To translate and serve the website in multiple languages, WPML would be a great fit and you can learn more about it from its official documentation:
https://wpml.org/documentation/

For any translations or WPML related questions, WPML's official support forum is available at:
https://wpml.org/forums/forum/english-support/

I hope these points will help and please let me know if you need any further assistance around these points.

You're welcome to open a new ticket for each new question or concern.

regards,
Waqar

#1688427

Hi, Waqar. Thanks for following up!

I have spent many days studying the documentation and trying different solutions. It seems that what I am trying to do is a little bit more complex than the examples being provided in the documentation.

I was hesitant to create single user profile post because I'm going to use this for all sorts of kinds of businesses, some of which will have many different custom fields and images. If I'd been creating this database myself, I would have set up various tables for the users and then the various business types, etc. so that there wasn't one giant row per user with hundreds of unused custom fields in each row. Is there any other way to do this that might be slightly more streamlined from the database side of things that won't overly complicate and perhaps even prevent me from searching the data later on?

What I ended up doing so far was to create a custom post type for each type of business/institution/organization/park/etc. if it's in the phone book, I need t listing for it in my directory and many of them will have special information to include. Currently, I have contact information plus other fields related to the running of a restaurant business in the restaurant custom post, for example. But this same restaurant owner may also want to post open positions in the jobs tool that I'm also creating. When the restaurant owner logs into the site, I want that person to be able to update their personal information (user profile custom post type), update their business contact information (business profile custom post type), details specific to their restaurant for the directory, and then also to be able to post many jobs available (jobs custom post type) with all of this being connected together, without having to enter their business contact information in more than once (business profile linked to jobs posts) or having that contact information bloat the database by being repeated potentially hundreds of times.

This came up in a conversation with Agnes on Friday and from what I understood, if it is set up this way then I may have trouble if I want to do certain kinds of searches on location due to platform limitations, say for example a tourist at a hotel wants to know everything that is nearby including restaurants, parks, doctors, etc.

Regarding the mapping, I'm going to need for the address field to contain only GPS coordinates because they don't have actual addresses for most of the businesses that I'm trying to put in the directory. They literally will refer to just a set of cross streets and the building will be nowhere near there. Some people may try to clarify by saying it's on this street, across from the pink house! Google Maps doesn't have comprehensive coverage of the area because it's so remote and they didn't even have street names there until a couple of years ago, only added for the tourists.

Thanks,
Jen

#1691491

Hi Jen,

Thank you for sharing these details and sorry about the delay in getting back on this.

Your observation is correct and our example websites and documentation cover more widely used basic usage scenarios so that new users can get familiar with key concepts. For complex requirements such as yours, workarounds and customizations can be incorporated, as needed.

I can understand your concerns related to using a single user profile post type for storing different types of profiles, for a database structure different from WordPress, where each post's all custom field/metadata is stored as a separate column in the same row. But that is not how WordPress stores custom field/metadata.

In WordPress, each custom field/metadata entry is stored in a different table from the posts, which is connected through the post's ID. This means that whether you use a single custom post type or multiple, the columns in the post table will remain the same.

You can read more about the WordPress database structure from these guides:
hidden link
hidden link

The type of business/institution/organization/park/ etc will only expand over time. If you're using one custom post type for each one, it would mean that in the admin area you'll have a long list of custom post types and the website's admin will constantly have to add new ones. Whereas if you're controlling the segmentation through a custom taxonomy, when each user profile is saved in a single post type, all the admin will have to do is add a new term in that taxonomy.

Combine this with a custom search challenge that Agnes pointed out, I still feel it is a better idea to use a unified "User Profiles" custom post type.

Here is how it would work:

1. A visitor comes to your website and registers using a user form. The basic and common information like name, email, contact information, address, etc, that will be needed for all types of listings, will be collected at this step and saved in the user custom fields.

2. In the dashboard area after logging in, he/she will see a form to add a new "User Profile".
( you can use a better name than "User Profile", maybe call it just "Listing" ).

3. From the form, he/she will pick which type of listing is this ( business/institution/organization/park/ ) that would be coming from a custom taxonomy.

4. Using conditional groups in form, he/she will only see the custom field input fields related to the selected category.

Likewise, he/can add as many listings in different types as desired, while being logged in as the same user.

Tip: I'll recommend creating two different test websites and test out both these approaches with some demo data and see how it works out.
( you're also welcome to share their links with me too so that we discuss things more specifically )

As for the "Address" type custom field, at the backend, it does store the actual Lat/Lon coordinates and not the human-readable addresses, so you have no challenge in this matter.
( ref: https://toolset.com/documentation/customizing-sites-using-php/functions/#address )

regards,
Waqar

#1693205

Hi Waqar,

Thanks for your note!

Regarding point 1, I'm using Ultimate Member instead of Toolset to manage the user login process because I needed to be able to enforce strong passwords and it didn't seem like this was possible with Toolset without customization and I don't know PHP or JavaScript.

Can I still use Toolset then to create a form to create and access custom fields for the user (address, birthdate, phone, etc.) after they have gone through the UM login process and are then logged into the site? And all of these user custom fields will be stored in the user table? And then these user fields are connected by post id to every single listing that this same user creates (business/jobs, etc)?

In point 2, can I set it up so that the user can pick from a set of URL links instead of a pull down menu? If this is all one giant form and I'm just showing someone chunks of it based on the taxonomy that is selected (either by URL or select box), will it be possible to show only some listing forms to regular subscribers and an expanded set of options to paid subscribers?

How would I manage this situation if everything is all in one custom post type? - Person A creates a user account, Person B creates a user account. Both own the same business. Can they both create/see/edit the business listing in their dashboards? Can both of them create/see/edit multiple job postings from their dashboards for this single business listing?

Thanks,
Jen

#1694281

Hi Waqar,

I'm working on implementing your suggestion. I've created a custom post type called Listings and a taxonomy called Listing Type (park, dentist, supermarket, hotel, airport, etc.).

I just started creating the custom field group for it and this is generating more questions. Is there any downside to creating one custom field group for listings with fields that are common to multiple listings and then custom field group for restaurant-only fields, park-only fields, etc.? I thought that at least this would help to keep the various groups of fields more organized for the administrator, but I figure maybe it will complicate things when I try to implement the various lists, forms, searches, etc.

I'm thinking how am I going to make input forms for the users that make sense when these fields are going to be shared by multiple business types? Say all listings are allowed to post 2 images, but I have the web pages that display this information designed differently so I don't want to call them Image 1 and Image 2 on the input form. For the restaurant owner I want to provide labels that say Plate of Food and Front of Restaurant and for the park I want to say Landscape Shot, Park Sign. How do I handle this?

If I want to create a page that lists all of the restaurants in alphabetical order by name, and then name (storing in the post title field) is a link to that page that shows a nicely formatted page specific to the restaurant taxonomy, how do I create the list page, the link, and the individual restaurant page (that may look very different from a park page, for example)?

Am I just supposed to have one content template with a whole bunch of conditional statements in it if I go with single custom post type for listing versus one for restaurant, park, etc? This is not how I would prefer to handle this so I'm hoping that I can just create a web page (instead of a content template) just for a restaurant but somehow be able to link to it when I'm creating lists of restaurants (hopefully this is also in another web page) - though for both of these I really want to be able to create views so that I can take these chunks of code and pull them into elementor, but I posted a separate question about that in the support forum. Right now, when I say want to pick post title with link for my list of restaurants, it seems to know to link to the restaurant content template automatically and there's no place for me to check/edit the link myself so I have no idea how I will do this if I am not using the single content template for this post type that I seem be be limited to.

Thanks,
Jen

#1697645

Hello,

Waqar is on vacation, I will take care this thread.

There are lots of questions in this thread, according to our support policy, we prefer one ticket one question, I am trying to answer them one by one.

Q1) Can I still use Toolset then to create a form to create and access custom fields for the user (address, birthdate, phone, etc.) after they have gone through the UM login process and are then logged into the site?

Toolset Forms plugin supports standard custom user fields, if those custom user fields you mentioned above are also standard custom user fields, you will be able to use Toolset Forms to manage them, for example, Dashboard-> Toolset-> User Forms, click button "Manage non-Toolset User Fields", you can find and enable those custom user fields created with other plugins, then you will be able to put them into your user forms.

And you can use Views shortcode [wpv-user] to display them in front-end
hidden link

Q2) And all of these user custom fields will be stored in the user table?
That depends on how do you setup those custom user fields, if they are user fields created with Toolset Types plugin, they are standard custom user fields, and store in the database table wp_usermeta, see WP document:
https://codex.wordpress.org/Database_Description#Table:_wp_usermeta

If they are created with other plugins, you will need to check their plugin author for it.

Q3) And then these user fields are connected by post id to every single listing that this same user creates (business/jobs, etc)?
In the single "listing", you can use shortcode [wpv-post-author] to display post's author user fields, see our document:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-user
Display details for the author of the current post.

Q4) In point 2...

I am missing in this thread, which one is point 2), please elaborate the questions with more details

Q5) How would I manage this situation if everything is all in one custom post type?
In your case, it needs to setup many-to-many relationship between WP users and post type "listing", there is a workaround within Toolset, for example:
1) Create two post types
- listing
- Member (each user can have only one member post)

2) Setup many-to-many relationship between WP users and post type "listing"
https://toolset.com/documentation/post-relationships/how-to-set-up-post-relationships-using-toolset/

3) In single Member post, you can follow our document to display it's related "listing" posts
Same as above, in single "listing" post, you can display related "Member" posts:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-many-related-items

More help:
https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/
How to Create Custom Searches and Relationships for Users

For other new questions, please create new tickets for them, thanks