Import Autotag Revisited

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.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1244854
    Scott
    Participant

    Hi, 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!

    #1246310
    Victor
    Member

    Hi 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

    #1249647
    Scott
    Participant

    Thanks 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?

    #1250043
    Victor
    Member

    Hi 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

    #1260883
    Support Droid
    Keymaster

    Hey 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

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Import Autotag Revisited’ is closed to new replies.