• Resolved sezgee

    (@sezgee)


    Hi,
    I am a pro user.

    We had an ics button on each single event that seems to have disappeared. Can you tell me how a user can export a single event listing to ics?

    I deactivated all plugins except TEC and reverted my theme, but the ICS button is still missing.

    I see your KB article on the overall SUBSCRIBE ics, but I need the single event button.

    I tried the extension for Outlook Export Buttons, but that goes to the web versions of Outlook and doesn’t give the .ics file.

    I’m fine with adding code to the templates or functions.php or installing an add-on. Please advise!
    Thanks.

    p.s. I submitted this request to the help desk 4 days ago and have had no response.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hey @sezgee

    Thank you for reaching out!
    Our apologies for the unusually long response time as our premium support team is handling a high volume of inquiries.

    Could you try the following snippet:
    add_filter( 'tec_views_v2_subscribe_link_ics_visibility', '__return_true', 12 );

    Let us know how that goes,
    Geoff

    Thread Starter sezgee

    (@sezgee)

    Thank you. To which file am I adding this? I tried in single-event.php (under after_the_content) and nothing showed up.

    <?php add_filter( ‘tec_views_v2_subscribe_link_ics_visibility’, ‘__return_true’, 12 ); ?>

    Thanks,
    Sez

    Plugin Contributor Andras Guseo

    (@aguseo)

    Hi, this would go in your child theme’s functions.php file.

    A.

    Thread Starter sezgee

    (@sezgee)

    Oh, great, thank you, that worked like magic! Can you tell me the template that controls those links so I can reorder/rename?
    Thanks again.
    Sez

    darylmediadesign

    (@darylmediadesign)

    Hi @aguseo

    I tried to add this code to my functions.php but this doesnt appear to work, have also tried to activate another theme and add to that function.php file, but no ics file export link appear, also looked on this guide – https://theeventscalendar.com/knowledgebase/k/remove-ical-and-google-calendar-links-from-single-event-views/

    What would you suggest next?
    Daryl

    Thread Starter sezgee

    (@sezgee)

    Daryl, here is the full code I added to my functions.php file to 1) add the ics button 2) rename the ics button 3) put the ics button first

    /* add export single event to ics, rename label, move it to front */
    
    add_filter( 'tec_views_v2_subscribe_link_ics_visibility', '__return_true', 12 );
    add_filter( 'tec_views_v2_single_subscribe_links_ics_label', static function() {
        return esc_html( 'Download .ics file' );
    } );
    add_filter( 'tec_views_v2_single_subscribe_links', static function( $links ) {
        // Prevents any filtering if ICS is not a link.
        if (  ! isset( $links['ics'] ) ) {
            return $links;
        }
    
        // Save ICS into a separate variable.
        $ics = (array) $links['ics'];
    
        // Remove ICS from the array, so it's not duplicate.
        unset( $links['ics'] );
    
        // Move ICS to the start of the array.
        $links = array_merge( $ics, $links );
        return $links;
    }, 15, 1 );
    darylmediadesign

    (@darylmediadesign)

    @sezgee I also tried this, but after further reading I realised I missed a setting on the guide:

    “Note: The following snippets only work with the Classic Editor.
    (Event → Settings → General tab → Activate Block Editor for Events is NOT checked.)”

    Plugin Support Jaime

    (@jaimemarchwinski)

    Great, it sounds like this thread has been resolved, so I’m going to go ahead and close it for now.

    Feel free to open up a new one if anything else comes up.

    Have a wonderful day!

    Thanks,?
    Jaime

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Export Single Event as .ics’ is closed to new replies.