Skip Navigation

[Resolved] waqas please a follow up

This support ticket is created 4 years, 10 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 40 replies, has 2 voices.

Last updated by martinP-13 4 years, 9 months ago.

Assisted by: Waqar.

Author
Posts
#1497377

sorry waqar it wont let me edit post above ,

4) just to clarify , if a person is in for example 'event a' and 'eventb' , these would not go on the same person participation post would they ? i would create 2 person partipation posts , each 1 would use the same person but the event would be set to a in 1 and b in the other?

5) hidden link for the sire (and dam) i want to show Breeder: Judge Status: Kc Affix: , when i set them it repeats the info for the page im on (which is pretty logial) is this a step to far? or could i use some sort of conditional ?

like normal thanks a bunch waqas , if i can get these 5 sorted i feel it will let me make great inrodes over the weekend!! if i can start making my vies by sunday id be well on my way!! many many thanks

#1498361

can you clarify please waqar or i face another 3 days of not being able to progress with this. many thanks in advance.
martin

#1498375

Hi Martin,

1). Glad that the usage and purpose of the extra "appearance" post types, is clear now.

To show the related posts, you'll find good examples from the single content templates that I've created on my test website:
hidden link
hidden link

Please note how for relationships where only one related post can exist, I've used "item" attribute method:
https://toolset.com/documentation/user-guides/views-shortcodes/item-attribute/
Screenshot: hidden link

And for relationships where multiple related posts can exist, I've used the post view method:
Screenshot: hidden link

2) & 3). During troubleshooting, I was able to reproduce this issue on my test website as well.

It turns out that the "The Events Calendar" plugin filters all event post queries on the website and removes the past events.
( it doesn't distinguish if the query is from their own plugin or from a different plugin or theme )

On your test website, only one event "DUCHY WORKING GUNDOG CLUB" is shown in the drop-down because that is the only event whose date hasn't lapsed.
Screenshot: hidden link

You can get in touch with their support team and ask if there is some code or option to make it stop filtering past event posts.

If they're not able to assist you with this, then you can consider switching to a different events management plugin.

4). Your understanding is correct and each person participation post represents a single record/entry for a person's participation in a specific role in a specific event.

5). If you would like to show multiple fields from a different dog than the current one ( in this case current dog's sire and dam ), you can use a post view to change the scope of the current dog through a post view and passing on the required dog's ID, as a attribute in the view's shortcode.
( similar to what we've discussed a number of times in the past )

You'll create a new post view for example "View to show dogs, related sire and dam - single dog page" and set it to show only that one dog post, whose ID is passed in the view's shortcode attribute.
( screenshot: hidden link )

Any information that you'll show through that new view's loop, will come from the targeted dog and not the current dog (whose page is being viewed).

After that, you can pass on the current dog's sire and the dam post IDs to that new view like this:


[wpv-view name="view-to-show-dogs-related-sire-and-dam-single-dog-page" ids="[types field='dog-sire' output='raw'][/types]"]

[wpv-view name="view-to-show-dogs-related-sire-and-dam-single-dog-page" ids="[types field='dog-dam' output='raw'][/types]"]

I've added this new post view and its shortcodes in the single dog page template on my test website for clarity.

Important note: Since now that we have a better understanding of the new structure, I'll suggest starting a new ticket for each new question or concern.
( you can mention in those new tickets that it is related to what has been discussed in this thread )

regards,
Waqar

#1498383

brilliant !! thank you so much waqar you have been amazing! have a great weekend!
martin

#1501121

You're very welcome Martin.

So glad that my suggestions proved useful and please keep sharing your questions, through new tickets.

You can mark this one as resolved and I'll reply to your new ticket soon:
https://toolset.com/forums/topic/waqas-please-display-a-jude-handler-etc/

#1503043

hi waqar, i think i may have to rethink this system and either revert back to the old system or accept i wont get the website completed im to far in to restart, i reached out to the events calendar regarding the past events being filtered ,( i cant choose event for person or dog apperance) here is what they said: have you any thoughts?

Hi Martin,

I did some further debugging, but this goes a little bit out of the scope of customizations that we do for customers since I don't know how the full scope of your project.

I can assure you the fix is related to our filters, being run on the AJAX request they are doing.

If you have a developer that can help you work on this the solution is around using

add_filter( 'tribe_events_suppress_query_filters', '__return_true' );
On the AJAX request that the Toolset plugin is doing the search, or overwriting their request to do the proper query to the database.

Since Events is such a heavily customized CPT it's really hard to catch all of these scenarios with third-party plugins that do generic requests.

If you do have a developer working on this let me know and I can for sure help him or her to get this resolved.

My Best regards,

thanks waqas

#1503877

i added
add_filter( 'tribe_events_suppress_query_filters', '__return_true' );

to my themes function file , it works and i can now select previous events. is there a way so that : add_filter( 'tribe_events_suppress_query_filters', '__return_true' ); will only function on the 2 pages for adding the person or dogs to the events? (id guess it was the cpt of dog appearce and person appearance ?

thanks waqar...

#1505337

Thanks for the update and glad that the "The Events Calendar" plugin's support was able to suggest a filter.

You can narrow down its scope so that it only executes for a specific AJAX call and action "types_related_content_action" (that generates the related posts selection lists) like this:
( ref: https://wordpress.stackexchange.com/questions/282645/is-there-a-hook-that-fires-before-an-ajax-call)


function events_calendar_filter_initialization() {
	// if its an AJAX request with specific action
	if( (defined('DOING_AJAX')) && (DOING_AJAX) && ($_GET['action'] == 'types_related_content_action') ) {
		add_filter( 'tribe_events_suppress_query_filters', '__return_true' );
	}
}
add_action( 'init', 'events_calendar_filter_initialization', 1 );

But please be warned that this workaround/code snippet is being shared just as a pointer and in case of any future changes introduced to how The Events Calendar plugin filters its post type or how the Toolset Types plugin generates the related posts selection list, you'll have to change/adjust it accordingly or hire a professional developer.

#1505347

thank you ever so much waqar , of course it worked flawlessly, can i ask some events share the same title which is making it guess work, then i have to detach and start again , where it shows the events is it possibe to have it show the date as well as the title?(im certain that toolset chooses this and not the events calendar plugin ) i really hope so as this new system is awesome! thanks

#1506947

Glad it works, Martin.

I've done some research and I'm afraid, there is no filter available to include the additional fields like date in that post-relationship meta box.

Instead of filtering the event post titles everywhere to make them recognizable or distinguishable, a good practice would be to make the event post titles unique by including the event date information, in a uniform format.

This way, wherever an event's post title will be shown it will be easily recognizable, without any extra work.

#1512091

My issue is resolved now. Thank you!