complement: Open Event Website URLs in new window from monthly calendar view

Home Forums Calendar Products Events Calendar PRO complement: Open Event Website URLs in new window from monthly calendar view

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1365918
    Fábio Antonucci
    Participant

    Hello, I have implemented the solution presented in this topic: https://theeventscalendar.com/support/forums/topic/open-event-website-urls-in-new-window-from-monthly-calendar-view/, by Victor, at
    August 28, 2017, changing the functions.php and single-event.php files and was very useful for me.

    I understand that the support is limited, but if they could help me to have the same result of targeting the url registered in the event (as we did in the monthly view) also in the button / link of the events by list, as print attached, would be fantastic.

    Can you please help me with this?

    * Sorry for English because I am from Brazil and I do not speak your language 100%.

    #1365922
    Fábio Antonucci
    Participant

    Sorry, please disregard the print attachment sent previously. The correct one is that.

    #1366539
    Victor
    Member

    Hi Fábio!

    Thanks for reaching out to us! Let me try to help you with that.

    By default, the list view does not show the event website. Are you customizing the list view to show the event website? If so, please share that code with us and will try to come up with a snippet to achieve what you are looking for.

    Thanks,
    Victor

    #1368766
    Fábio Antonucci
    Participant

    Hello Victor, that’s exactly what I need. Many thanks for the feedback!

    Actually, I tried to adapt the code used for the monthly view, according to your post.

    In the theme’s functions I just added the excerpt
    if (! tribe_is_list ()) {
    return;
    }

    The following is an integral part:

    // Set target ‘_blank’ for tribe_get_event_website_link ()
    add_filter (‘tribe_get_event_website_link_target’, function () {return ‘_self’;}, 10);
    // Set the event title as label for tribe_get_event_website_link ()
    add_filter (‘tribe_get_event_website_link_label’, ‘custom_event_website_link_label’, 10);
    function custom_event_website_link_label () {
    if (! tribe_is_month ()) {
    return;
    }

    if (! tribe_is_list ()) {
    return;

    }
    $ title = get_the_title ();
    return $ title;
    }

    And in the file public_html / sandbox / wp-content / plugins / the-events-calendar / src / views / list / single-featured.php, at the end of the file where you have the button (line 77, 78)

    <! – Event Content ->
    <? php do_action (‘tribe_events_before_the_content’)?>
    <div class = “tribe-events-list-event-description tribe-events-content”>
    <? php echo ($ event_website)?>
    <?php echo esc_url ($link) ?> “class =” tribe-events-read-more “<? php esc_html_e (‘Find out more’, ‘the-events- calendar ‘)?> & raquo;
    </ div> <! – .tribe-events-list-event-description ->
    <? php
    do_action (‘tribe_events_after_the_content’);

    Sorry, I’m not a programming expert and I get a little lost. If you can help me with this change, it will be fantastic. Please, I await your return.

    #1369117
    Victor
    Member

    Hi Fábio!

    We have an extension to accomplish what you are looking for > https://theeventscalendar.com/extensions/make-event-titles-link-to-the-event-website-url/

    Please give it a try and let me know if it works for you.

    Best,
    Victor

    #1369193
    Fábio Antonucci
    Participant

    Show Victor! that’s what you need. Many thanks for the help!

    #1369498
    Victor
    Member

    Great to know that Fábio!

    I’ll go ahead and close this thread but feel free to open a new topic if anything comes up and we’d be happy to help.

    Cheers,
    Victor

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘complement: Open Event Website URLs in new window from monthly calendar view’ is closed to new replies.