Home › Forums › Calendar Products › Events Calendar PRO › Open event links in new window/tab
- This topic has 4 replies, 2 voices, and was last updated 6 years, 5 months ago by Hassan.
-
AuthorPosts
-
November 10, 2017 at 3:39 am #1379749HassanParticipant
Hi there,
I’ve been trying to solve this by myself but nothing worked out for me š
First I am trying to set that when clicked on all the events on the calendar open in a new window/tab (https://rotterdampages.com/events/).
I’ve tried every suggested solution for this t but without succes. I’ve tried all these:
https://theeventscalendar.com/support/forums/topic/event-details-page-open-website-in-new-window/
https://theeventscalendar.com/support/forums/topic/open-event-url-link-in-new-tab-or-window/
https://theeventscalendar.com/support/forums/topic/open-website-in-new-window/
https://theeventscalendar.com/support/forums/topic/organizer-and-venue-links-open-in-new-tab/
https://gist.github.com/GeoffEW/4406403775fe4efab39b9d5baae757aeand many more.
However, when i tried this (https://theeventscalendar.com/support/forums/topic/open-organizer-and-venue-links-in-new-window/) it worked but for all links even from other pages both internal as external and that’s not the way I want it to go.
This (https://theeventscalendar.com/support/forums/topic/changing-calendar-links-to-open-new-tab/) worded well for the google ical links but not for the events.
I tried the Open external links in a new window plugin and that works for https://rotterdampages.com/event/ or https://rotterdampages.com/events/ but does not work when you click next or previous month on the calendar because the link becomes https://rotterdampages.com/events/2017-12/.
How can we fix this?
Thank you and greetings,
Hassan
November 13, 2017 at 6:00 am #1381436PatriciaMemberHey Hassan,
Thank you for reaching out to us!
As I can see from here you are using the month view calendar by default. In this case, the simplest way to achieve what you want is with a template override. Please copy the single-event.php file from the-events-calendar/src/views/month and paste it to [your-theme]/tribe-events/month/single-event.php
Now, please open the file you just copied to your theme and replace line 196 with:
" class="url"><?php echo $title ?>
In this case we are just replacing
with
Link
.Does it help you to solve the problem? If you have any other questions at all please feel free to let me know and Iād be happy to help as best I can!
Cheers,
Patricia
November 13, 2017 at 2:35 pm #1381956HassanParticipantHi Patricia!
it finally worked!
The lines you suggested did not work entirely because line 196 in single-events.php had different coding, so I adjusted it a bit and now it’s working.
This is what I had in single-event.php file from the-events-calendar/src/views/month:
<h3 class="tribe-events-month-event-title"><a href="<?php echo esc_url( $link ) ?>" class="url"><?php echo $title ?></a></h3>
And I changed it into this:
<h3 class="tribe-events-month-event-title"><a href="<?php echo esc_url( $link ) ?>" target="_blank"< class="url"><?php echo $title ?></a></h3>
And now it finally works! Superthanks!
Greetings,
Hassan
November 14, 2017 at 9:08 am #1382696PatriciaMemberHi Hassan,
You are welcome! I’m glad to hear that everything is working as expected now š
If you have any other questions at all please feel free to open a new thread and we will be happy to help!
Cheers,
Patricia
-
AuthorPosts
- The topic ‘Open event links in new window/tab’ is closed to new replies.