Home › Forums › Calendar Products › Events Calendar PRO › complement: Open Event Website URLs in new window from monthly calendar view
- This topic has 7 replies, 2 voices, and was last updated 8 years, 6 months ago by
Fábio Antonucci.
-
AuthorPosts
-
October 19, 2017 at 7:12 am #1365918
Fábio Antonucci
ParticipantHello, 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%.
October 19, 2017 at 7:15 am #1365922Fábio Antonucci
ParticipantSorry, please disregard the print attachment sent previously. The correct one is that.
October 20, 2017 at 9:22 am #1366539Victor
MemberHi 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,
VictorOctober 25, 2017 at 9:48 am #1368766Fábio Antonucci
ParticipantHello 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.
October 26, 2017 at 6:09 am #1369117Victor
MemberHi 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,
VictorOctober 26, 2017 at 7:47 am #1369193Fábio Antonucci
ParticipantShow Victor! that’s what you need. Many thanks for the help!
October 26, 2017 at 11:18 am #1369498Victor
MemberGreat 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 -
AuthorPosts
- The topic ‘complement: Open Event Website URLs in new window from monthly calendar view’ is closed to new replies.
