Home › Forums › Calendar Products › Event Aggregator › Import Autotag Revisited
- This topic has 5 replies, 4 voices, and was last updated 9 years ago by
Scott.
-
AuthorPosts
-
February 23, 2017 at 2:04 pm #1244854
Scott
ParticipantHi, I’m interested in this earlier thread: https://theeventscalendar.com/support/forums/topic/import-autotag/
Is is possible to do dynamic tagging with imported calendars too?
Something like:
– Import of Google Calendar 1 with “x” keyword, gets “y” category and “z” tag.
– And Import Google Calendar 1 with “a” keyword, gets “y” category and “b” and “c” tags.What might a solution to this look like?
Thanks in advance for your help!
February 27, 2017 at 10:10 am #1246310Victor
MemberHi Scott!
Thanks for coming back to us!
There is no easy way to assign tags dynamically like you mention.
The following is a snippet you can add in your theme’s functions.php file that will add the tags “pizza” and “taco” to all the imported events, every time they are saved – This means whenever you import or edit an event that was created using Event Aggregator.
/* Tribe, add tag to Event Aggregator new imported events */ function tribe_tag_ea_imported ( $event_id, $data ) { // bail if the event has not been imported via Event Aggregator if ( get_post_meta( $event_id, '_EventOrigin', true ) != 'event-aggregator' ) return false; // set tag wp_set_post_tags( $event_id, 'pizza, taco', true ); } add_action( 'tribe_events_update_meta', 'tribe_tag_ea_imported', 10, 2 );You can use this code as a starting point for other settings you may need to add to an imported event.
I hope that helps. Let me know if you have any other questions.
Best!
Victor
March 5, 2017 at 10:02 am #1249647Scott
ParticipantThanks for your help Victor. That didn’t quite fit our need, but we found a workaround using parent categories. (As a feature request: just as we can auto-assign an unique category per import, it’d be helpful to assign unique tag(s) too)
One new question…
For imports with an auto-assign category, can the system add the category instead of replace the existing category?For example, we manage 30 teams by assigning them their own category. And for a single event, 4 teams will attend. From a single google calendar, we have 4 separate imports scheduled for each team’s identifying keyword: Team-1, Team-2, Team-3, Team-4.
Currently:
– Scheduled import runs at 7:55pm, pulls up event for “Team-1” keyword — Assigns to Team 1 category.
– Next scheduled import runs at 8:00pm, pulls up event for “Team 2” keyword — replaces Team 1 category with Team 2.We’re looking for, 7:55pm import runs — adds Team 1 category. 8:00pm import runs — adds Team 2 category. Event is now assigned categories Team 1 and Team 2.
Do you have any advice here?
March 6, 2017 at 12:00 pm #1250043Victor
MemberHi Scott!
I’m glad you could achieve what you were looking for! As for the feature request, there seems to be other users who also want it. Here > https://tribe.uservoice.com/forums/195723-feature-ideas/suggestions/17040562-event-aggregator-categories-tags you can vote it so it helps to make it through the list of next features.
For imports with an auto-assign category, can the system add the category instead of replace the existing category?
Unfortunately, there is no easy way to achieve this at the moment that doesn’t involve a customization. I’ve been trying to achieve this with a code snippet but couldn’t get one that really works. Although we don’t really support customizations, I will reach to the team and see if I we can come up with a snippet that at least could point you in the right direction. But it may take us until tomorrow or more to reply back.
It seems like something that could also be implemented as a new feature, so in the meantime, I encourage you to post it as a new idea here so other users can vote for it.
Thanks!
Victor
March 28, 2017 at 9:35 am #1260883Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Import Autotag Revisited’ is closed to new replies.
