Skip Navigation

[Resolved] post relationships

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/Karachi (GMT+05:00)

Author
Posts
#2658211

Tell us what you are trying to do?
Hello, on this website, you will find various types of musicians, artists, and films performing on different stages, days, and schedules. I'd like to organize this in the most effective way possible, but I'm not entirely sure if I should use custom post types or taxonomies to establish relationships between them.

Let me clarify: This is a festival that features music, cinema, theater, and exhibitions. Each musician will perform on a specific day, while for theater, there will be multiple stages and showtimes. Cinema will only be shown on two stages with a single screening. Exhibitions encompass multiple days, lasting longer than the festival itself.

My initial idea was to create custom post types for Artists, Stages, Schedules, and Days and utilize post relationships to connect them all, enabling filtered searches.

In other words, I'm interested in, for instance, seeing the artists performing on the same stage on the same day or all theater performances on a specific day and the corresponding stages.

This festival spans six days with the exception of the exhibitions, which extend beyond that time frame.

Is it possible to achieve this using Post Relationships?

Is there any documentation that you are following?
Toolset Course Lessons

Is there a similar example that we can see?
No

What is the link to your site?
actualfestival.com

#2658395

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

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

Based on the requirement that you've shared, this is the structure that I'll recommend:

1. You can register a central custom post type and name it something like 'Events', 'Performances', or 'Appearances', whatever sounds better. For this discussion, I'm going to use the name 'Appearances'.

2. Additionally, you can register these custom taxonomies for this post type:
- Type ( examples: music, cinema, theater, and exhibition )
- Venues/Locations ( examples: stage name, hall name, screen name, etc. )
- Artists ( examples: names of individual artists or bands )

3. For additional information like date and time, you can attach custom fields with the 'Appearances' post type.

For repeating appearnaces/events or which span across multiple dates and times, it is important, that you include a separate record/post for each individual appearnaces/event and not try to define it by adding multiple dates and times within a single post. This approach will help in performing search and narrowing down to individual performances, by date, type, artist or location.

I hope this helps and please let me know if you need further assistance.

regards,
Waqar

#2658427

Hi, this is how I had it until now, but if I want to show the artists that are performing on the same stage on the same day, it wouldn't let me. What I want is to be able to add something similar to this https://toolset.com/course-lesson/displaying-related-posts/ That when I see the tab of an artist I can see the other artists performing on that stage. And if I search by stage, I can see all the artists performing on that stage.

#2658755

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for writing back.

I'm reluctant to suggest an approach that relies heavily on the post-relationships, since, in my experience when multiple filtering parameters get involved, it becomes limiting.

For example, in a view a post relationship filter can be used for only one relationship and you can't filter by multiple relationships at the same time.

Additionally, in terms of performance too, post-relationship filtering is the slowest compared to the taxonomy or the custom field filtering. For this reason, while designing the structure and whenever possible the preference should be given to filtering options in this order (from fastest to slowest):

- Taxonomy
- Custom Field
- Post relationship

> but if I want to show the artists that are performing on the same stage on the same day, it wouldn't let me
- In the proposed structure, If you know the 'venue' and the target date, you should be able to filter out the appearances and show the performing artists.

Can you please share temporary admin login details, along with the link to the page where you tried to use such a view? I'll be happy to take a look and suggest the necessary adjustments.

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

#2659603

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing the access details.

Your set up overall looks good, but I'll recommend changing the custom field 'Fecha y hora' for date, to only store the date and not the time.
( screenshot: hidden link )

Reason for this change is that the date type field stores the value in a UNIX timestamp format. And when no time information is saved, it uses the UNIX timestamp value at 12 am of the selected day. This single value for each date will simplify the filtering by date as it will just be a single value and you'll not have to worry about the start and end times on the selected dates.

Note: For showing the time information, you can use a separate custom field, but it is better to keep it independent from the date, which will be used for the filtering purposes.

To demonstrate how filtering by different elements like artist, stage and date will work together, I've created a simple view on the website named "View to show events, filtered by artists, stages and date":
hidden link

It can be seen on a page named 'Test Page from TS support':
hidden link

In this example view, the filtering is performed based on the front-end search fields. But based on the requirement, the each of these filtering parameters can be provided through a shortcode attribute or the current post/page or the current term, if you're using it inside a taxonomy view.

I hope this helps and let me know if you have any follow-up questions.

#2660975

Ok, thank you i will try

oscarO-5 confirmed that the issue was resolved on 2023-11-06 08:54:39.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.