Skip Navigation

[Resolved] Building a private Golf Tour Itinerary Site

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

This topic contains 7 replies, has 3 voices.

Last updated by Jamal 3 years, 3 months ago.

Assisted by: Jamal.

Author
Posts
#2135587

We have a new project, which requires us to develop a private dedicated golf tour itinerary site for a clients own clients going on one of their gold tours.

So, it will list brief narrative details of each day on the tour, along with All the golf courses being played (these don't need to be linked to the day), just displayed as part of the tour itinerary along with the hotels (again these don't need to be listed on a day by day basis). Finally all the restaurants in that 'area'.

The hotel section will consist of a single picture, then narrative about the hotel. The same with the golf courses and the Restaurants is putely narrative.

Our initial thoughts are to build a single Toolset content template, with all the golf courses, hotel and restaurants hard-coded into the template code, and we then use conditional 'IF' and 'Not Null' statements as to wheter that particular code snippet is displayed.

So, the client enters the narrative on a day by day basis and then ticks boxes as to what courses, hotels and restaurants they need to display for that particular itinerary. Keeps it nice and simple.

We know this will work, as we have used this methodology on another Toolset project for displaying social media links and YouTube videos.

However the reason for this support question, is whether there is a better way of doing this?

SEO is not an issue, so it doesn't matter that the content template will be quite large. Also the client is not bothered about being able to add/edit/delete hotels and restaurants, so we can just edit the HTML code for the template if there are any changes.

Just want to bounce the idea off the experts 🙂 This is only our 3rd Toolset site!

#2135787

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2021-08-06 at 16.45.36.png

It sounds like you are happy to do a certain amount of manual intervention when it comes to adding content to itineraries etc., so I don't think your requirements are that complex.

But I wouldn't necessarily do what you describe in terms of including everything in one giant template and enabling/disabling sections.

I think you should make a post type for Hotels, another for Golf Courses, and another for Restaurants.

Then add posts for each of them. You could just include everything you need in the post content directly (e.g. images, some data such as contact details), pretty simple with the block editor.

Then on some page that will act as the itinerary (you understand what you are aiming for here better than I), you insert hotel posts, restaurant posts etc. as needed.

How do you do that?

Well, edit a page, insert a Single Field block, and then for the source specify not the current page but search for the post you want to insert (e.g. a hotel post), and then insert the Post content (body).

In the screenshot you can see me doing that on a test site (which has a lot of demo content with latin titles).

#2137423

Hi Nigel

Thanks for getting back to me, and what you have suggested sounds good.

Can I just check, that the Hotels, Golf Courses and Restaurant individual posts could all be 'selected' via a tick box? So, the client would fill in the itinerary for each day of the golf tour, and then just simply tick the relevant hotels, restaurants and golf courses applicable to the tour?

Basically I need an easy way for the client to select the CPT's for that specific itinerary.

Finally, the client wants to use an accordion style display for the golf courses, hotels and restaurants and we were thinking Bootstrap would work fine in the tour content template, so just want to check we can bring up the HTML code for the view display and add it to the Bootstrap accordian in the template.

Cheers
Ade

#2137753

Hello Ade, I hope that you wouldn't mind me continuing with you on this ticket.

Because you brought HTML a couple of times on your message, I would suggest using the legacy editor instead of the blocks editor that Nigel has, implicitly(the screenshot), suggested to use. The legacy editor will give you more control over the produced HTML than the blocks editor. This way you can fully use the features of Bootstrap.

This being said, I must confess that I need more details to understand the project better. I'll ask some questions, and I hope you can also add any details that might be related:
- Will the client use the backend(wp-admin) or Toolset forms to enter the data(itinerary of each day).
- Can you give some examples of the pages that will be used(separate pages for hotels, restaurants, courses)?
- I assume that the hotels and restaurants will be added before launching the site, is that right, or will the client need to add more hotels and restaurants after launching the site?
- Will the website be private(behind user/password) or public on the internet?

#2137897

Hi Jamal

Thank you for replying so quickly to my questions and of course I do not mind you continuing with this ticket.

I did think the legacy editor would be more suited for this project and thank you for confirming this.

To answer your questions:

1) The client will use the backend wp-admin console to enter the data into the various CPT's.

2) The client is wanting just a single page for their customers golf tours, with the itinerary for each of the days listed at the top. then below this in an accordion style display will be all the golf courses they are playing on, the hotels they will be staying in and the restaurants where then can eat. Also local information and sight-seeing places to visit.

The idea is, on one page, their clients on the fold tours, will have all the information they need, easily to hand.

3) The golf courses, hotels and restaurants will be pre-entered (planning to import via a CSV) and thereafter our client can add new hotels/restaurants and edit/delete existing records.

4) The website will be totally private, and we only want those people on the tour to be able to view their tour. So there will be lots of different tours, but people on tour A will not be able to view Tour B itenerary and so on.

What we need is for our client to be able to enter the itinerary on a day by day basis and then be able to select the golf courses, hotels and restaurants relevant to that tour wgen entering the days, and then for the content template to build the single page, which their clients can login in to privately.

On some of the larger tours, there will be a number of golf courses and hitels, and we want each one to be displayed when you open the accordion for that section.

Hopefully this makes sense.

Kind regards
Ade

#2137947

Thank you very much for these details, I understand the needs better and I feel I can give accurate advice.

Because the project will need only one page, I think it can be implemented without any content templates. However, content templates are really powerful.

Keep in mind that a content template is meant to display ONE post. It can be assigned or unassigned. I mean by assigned, that it will be used to display the single page for that post. The unassigned content templates can be (re)used in views, archive templates, or even inside other content templates. They can also be used using shortcodes.

This being said, I'll try to comment about this project below:

Because you need to display to each user only their tours, you will need a way to do it. I can imagine several ways to do it(custom fields, custom code, maybe more ways.), but I believe the easiest way is to mirror each user to a custom post type. You can call it Members, or Profiles. This way we can use relationships to link users(the corresponding member post) to the Tours' posts. We have an interesting article about it and I highly recommend reading it https://toolset.com/course-lesson/how-to-create-custom-searches-and-relationships-for-users/
If a user can participate in multiple tours, the relationship must be a many-to-many relationship. There will also be a need for 2 other relationships that will connect hotels and restaurants to Tours.

The main page will use a couple of views. Views inside of views. For example:
- The page will use a view that queries the Members' posts authored by the current user. It should return only one post, the one that mirrors the current user. Check the screenshot "View with the post author filter" from the previous article.
- Inside of this view's loop, but the second view. Which should query the Tours' posts related to the post in the loop(it is the member post).
- Inside that view's loop, you can display the tour's data, or you can use a content template to display them.
- Always inside the view's loop or the content template that is used inside of it, you can put 2 other views to display the hotels and restaurants related to the current post in the loop(the tour post).

I hope this makes sense and gives a general idea of how to achieve this project. Let me know if you have any further questions about a specific step.

#2138847

Hi Jamal

Thanks for the comprehensive reply, which does make sense.

The only thing I am not sure about, is how when creating the tour itinerary, our client will 'select' the golf courses, hotels and restaurants that are specific to just that tour. We need a method that is very simple - basically just ticking boxes. However I am sure that as this project progresses it will become apparent what we need to do.

So, I have just emailed our client with the 'recommendation' that to progress this project, we need to start work on building a development site, because it is much easier for all of us to work with a live site, that you can access and see what we are trying to achieve and also for the client to understand what we are doing.

I am sure I will be back in touch.

Kind regards
Ade

#2139267

Hello Ade,

Toolset Forms offer by default Select2 controls to choose the related posts. That's what you will get, by default, for linking tours to courses. Courses to hotels and restaurants, etc.

Toolset Helps WordPress Professionals Build Advanced Sites Without Programming. However, for advanced customizations, using some custom code might be required.
It is possible to present those options(the related posts) as select dropdowns, radio buttons, etc. But, this might allow you to mirror a custom field into a custom post type.
There is also a filter that may change the options of a custom field, please note that it is relevant only to custom fields:
- The wpt_field_options filter https://toolset.com/documentation/programmer-reference/types-api-filters/#wpt_field_options
The following Tools Forms hooks will let you add your control to separate stages of form submission:
- For validation, use the cred_form_validate filter.
- To modify the data before Toolset saves it, use the cred_before_save_data action.
- To execute additional logic after the data is saved, use the cred_save_data action.
You will find additional hooks on the following page https://toolset.com/documentation/programmer-reference/cred-api/

Toolset Forms offer also a generic field shortcode. The values submitted on the generic fields are not processed by Toolset. They need to be processed by custom code in one of the Forms hooks.

We also offer a Relationship API to programmatically manipulate the relations between posts. https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/

You can find several examples of using these hooks in our documentation and in the forum. Use scoped google search to easily find them. hidden link
For example hidden link

I hope this gives additional insights about Toolset. Let us know if you have any questions.

All the best,
Jamal