Make other Website URLs a linked word or button

Home Forums Calendar Products Events Calendar PRO Make other Website URLs a linked word or button

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1181815
    Monica Filos
    Participant

    Hi, I was able to work a button for the event website url following the instructions on this page:
    https://theeventscalendar.com/knowledgebase/url-as-word-button/

    But now I need to make similar buttons for the organizer and venue website urls as well. Is it a matter of repeating the same snippet but replacing the field name? and if so, could you please tell me what the names of such fields are so I can proceed from there?

    Thanks,
    Monique

    #1182230
    Cliff
    Member

    Hi Monica.

    You can use the tribe_get_organizer_website_link_label and tribe_get_venue_website_link_label hooks for Organizers and Venues.

    You’ll need to do a bit of other editing but that should get you started.

    If you can’t get it, please share what code you come up with and I’ll take a look and try to fix it for you.

    #1183107
    Monica Filos
    Participant

    Hi Cliff,
    Thank you, that did it and I was able to replace the text for the button. Now, where and how do I remove the “Website” remaining headings?

    Following the initial tutorial (https://theeventscalendar.com/knowledgebase/url-as-word-button/), I was able to do that for the main page website label following these instructions:

    Make a copy of the details.php file. It is located in /plugins/the-events-calendar/src/views/modules/meta/details.php.
    Make a new folder in your theme directory called tribe-events
    Make a new folder in that one called modules
    Make a new folder in that one called meta
    Drop the copied details.php file in that last folder
    Now that the template is in the theme, it can be customized to suit your needs. In this case, remove the following line from the template (at time of this writing, it’s in line 148):

    <dt> <?php esc_html_e( ‘Website:’, ‘the-events-calendar’ ) ?> </dt>

    Could you please tell me the filename and lines I need to remove to do the same for both organizer and venue?

    I dont want to mess it up 😉

    Thank you and regards,
    Monique

    #1183299
    Cliff
    Member

    Monique, thanks for your detailed question.

    You’ve got it.

    It’s a similar process for organizer.php and venue.php in those same directories.

    Please let me know how it goes for you.

    #1183424
    Monica Filos
    Participant

    Hi Cliff, check the following images:

    Buttons01: BLISS… THANK YOU!!!
    Buttons02: ALMOST BLISS… how do I make the word “Teléfono:” to get displayed before the phone number and “Dirección” which stands for address before the address? (interestingly enough, for the organizer, it does it!
    Buttons03: Functional but not a bliss… yet!!! Looks jammed! How do I make it look like Buttons02, including the phone label feature asked for image Buttons02? And also the words “Correo electrónico:” which stands for email in Spanish before the email?

    I also noticed that for the organizer there is no google map option… that´s ok but it would have been nice.

    Regards,
    Monique

    • This reply was modified 7 years, 6 months ago by Monica Filos.
    • This reply was modified 7 years, 6 months ago by Monica Filos.
    #1183519
    Cliff
    Member

    I’m glad you’re making progress.

    For spacing, I believe you’ll need to make such customizations via CSS. If you provide me the link to a single event and tell me what you want, I should be able to get you started in the right direction.

    Location functionality is only available for Venues, not Events or Organizers. Although a longshot, if desired, you could request this as a new feature (or maybe search to see if the idea was already posted by someone else) at our plugins’ UserVoice page.

    This allows others who are interested in that feature to easily voice their support. We frequently review suggestions there to find out which ones are popular, then we implement as many of them as we can.

    If you post it / find it, feel free to link to it from here in case anyone comes across this forum thread in the future.

    #1188880
    Sarah Cardella
    Participant

    I was wondering if you could help me with this exact same issue? I’ve gotten the Event Website URL to display a “View Website” link just fine, but I’m having trouble with the Organizer and Venue links displaying as a “View Website” link. If you can point me in the right direction, I’d really appreciate it. Here’s the code I’m using for the three different links. All of this is in my functions.php file.

    //Change Event URL to linked word instead of showing long URL
    add_filter('tribe_get_event_website_link_label', 'tribe_get_event_website_link_label_default');
    
    function tribe_get_event_website_link_label_default ($label) {
      if( $label == tribe_get_event_website_url() ) {
        $label = "Visit Website &raquo;";
      }
    
      return '<a href="' . tribe_get_event_website_url() . '">' . $label . ' </a>';
    }
    
    //Change Organizer URL to linked word instead of showing long URL
    add_filter('tribe_get_organizer_website_link_label', 'tribe_get_organizer_website_link_label_default');
    
    function tribe_get_organizer_website_link_label_default ($label) {
      if( $label == tribe_get_organizer_website_url() ) {
        $label = "Visit Website &raquo;";
      }
    
      return '<a href="' . tribe_get_organizer_website_url() . '">' . $label . ' </a>';
    }
    
    //Change Venue URL to linked word instead of showing long URL
    add_filter('tribe_get_venue_website_link_label', 'tribe_get_venue_website_link_label_default');
    
    function tribe_get_venue_website_link_label_default ($label) {
      if( $label == tribe_get_venue_website_url() ) {
        $label = "Visit Website &raquo;";
      }
    
      return '<a href="' . tribe_get_venue_website_url() . '">' . $label . ' </a>';
    }

    Can you let me know what I’m doing wrong in the Organizer and Venue snippets above?

    Thanks!

    #1189369
    Cliff
    Member

    Pluto, thanks for sharing your code snippet. It works just fine for me:

    If you need further assistance, please create your own thread.

    Monica, please let me know if you need any further help here as well.

    Please note that threads get Closed automatically after a couple weeks of inactivity. If it does get Closed, please open a new thread, adding your current problem description and also linking back to this thread.

    Thank you!

    #1189639
    Monica Filos
    Participant

    Hi Cliff, the url to one of the locations would be http://www.sustanciainfinita.com/ubicacion/hotel-doubletree-by-hilton/

    Right after the website button begins the address and phone number and I would like to add the words Address and Phone number before each one and to also have each (address and phone number) to be on its own line and not altogether.

    Regards,
    Monique

    #1189769
    Cliff
    Member

    Monica, I believe you’d need to reference the Themer’s Guide and override this file:

    /wp-content/plugins/events-calendar-pro/src/views/pro/single-venue.php

    Please let me know if you have any follow-up questions on this topic.

    #1189834
    Monica Filos
    Participant

    Bliss!!!! Took me a couple of minutes to figure the styling because the class factor comes from another place but Im becoming a pro thanks to you hahaha… YOU RULE!!!

    #1189925
    Cliff
    Member

    I’m very glad to hear that. 🙂

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Make other Website URLs a linked word or button’ is closed to new replies.