Home › Forums › Calendar Products › Events Calendar PRO › Link URLs append slash to end
- This topic has 4 replies, 3 voices, and was last updated 10 years, 7 months ago by
Support Droid.
-
AuthorPosts
-
September 28, 2015 at 11:35 pm #1009536
Adam
ParticipantI added this snippet into functions.php so that clicking the link opens the web site link of the event:
/*
* This changes the event link to the event website URL if that is set.
* NOTE: Comment out the add_filter() line to disable this function.
*/
function tribe_set_link_website ( $link, $postId ) {
$website_url = tribe_get_event_website_url( $postId );// Only swaps link if set
if ( !empty( $website_url ) ) {
$link = $website_url;
}
return $link;
}
add_filter( ‘tribe_get_event_link’, ‘tribe_set_link_website’, 100, 2 );This appends a slash to the end, which generates an invalid URL.
How can I remove the URL? It isn’t coming as in this filter and seems to be added later./civicrm/?page=CiviCRM&q=civicrm/event/info&reset=1&id=6/
September 29, 2015 at 9:28 am #1009726Cliff
MemberHi Adam. Thanks for your question.
So I can be clear what you’re attempting to do, are you wanting to replace the link in the Calendar view so it links to the single event’s website field URL instead of linking to the single event itself?
If not, please clarify exactly where you’re wanting to replace the link.
September 29, 2015 at 7:39 pm #1009898Adam
ParticipantWhen clicking the link to view the calendar entry, I want it to go to the external link (as we’re integrating with CiviCRM events). It works, apart from the URL having a slash on the end of it (which then generates an incorrect URL).
September 30, 2015 at 10:27 am #1010121Cliff
MemberAdam,
Maybe it’d help to change
$link = $website_url;to$link = trim( $website_url, '/' );I hope this helps you get it figured out, but I do need to remind you that we can point you in the right direction toward customizations, but we cannot provide support for custom code or integrations, per our “scope of support” Terms.
I’d love to hear if you got it figured out. And, if you do, you’re welcome to post the code here for others to possibly benefit from in the future.
Thank so much for your understanding and for being a valued customer!
October 15, 2015 at 7:05 am #1014878Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Link URLs append slash to end’ is closed to new replies.
