list-widget

Home Forums Calendar Products Events Calendar PRO list-widget

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1098598
    audrey
    Participant

    This is a follow-up question to a previous topic which is now closed.

    Previous question:
    I would like the View more link to go to a list instead of the calendar. Can this be done even though the default view of the Events (main page) is Calendar?

    Previous answer:
    Thanks for reaching out to us!

    You can accomplish this by following our Themer’s Guide to copy the list widget file found within the core Events Calendar plugin at src > views > widgets > list-widget.php file and copying it into your theme and modifying that link within that file to link to “/events/list”.

    Let me know if this helps.

    Follow-up question:
    Can you provide the specific code for “modifying that link within that file to link to “/events/list” ?

    #1099180
    Geoff
    Member

    Hello Audrey,

    Sure! It’s changing this:

    <p class="tribe-events-widget-link">
    <a href="<?php esc_attr_e( esc_url( $link_to_all ) ) ?>" rel="bookmark">
    <?php esc_html_e( 'View More&hellip;', 'tribe-events-calendar-pro' ) ?>
    </a>
    </p>

    …to this:

    <p class="tribe-events-widget-link">
    <a href="/events/list" rel="bookmark">
    <?php esc_html_e( 'View More&hellip;', 'tribe-events-calendar-pro' ) ?>
    </a>
    </p>

    Do note, however, that correct file to do that in is located in the Events Calendar PRO plugin, under src/views/widgets/list-widget. The original answer advised you to look in the core plugin.

    Cheers!
    Geoff

    #1099825
    audrey
    Participant

    Geoff,

    I implemented this change but the ‘View More’ link still produces the calendar as the default, not a list. I did have to use a path slightly different from the one you mention. i.e.,

    src/views/pro/widgets/list-widget.php

    Any ideas??

    #1099867
    Geoff
    Member

    Hmm, that is very strange. It seems to work when I give it a try, so that’s perplexing.

    What happens if you try making the change to the original file from the first reply you got? Does that make a difference?

    Geoff

    #1100161
    audrey
    Participant

    The first reply suggested this –
    “copy the list widget file found within the core Events Calendar plugin at src > views > widgets > list-widget.php file”

    Can you provide me with the complete path to this file? The path I am using to get to the Pro file is –
    /wp-content/plugins/events-calendar-pro/src/views/pro/widgets

    #1100224
    Geoff
    Member

    Sure! It’s located at:

    wp-content/plugins/the-events-calendar/src/views/widgets/list-widget.php

    #1100254
    audrey
    Participant

    The code is a little different in this list-widget.php file. I assume I will use the replacement code

    as before. What code should I replace in this file? Probably
    ” rel=”bookmark”>
    Is that correct?

    #1100256
    audrey
    Participant

    Geoff,

    I see on the Forum that parts of my message are missing. I’m not sure what happened. Since the code is a little different in this list-widget.php file I was asking about what edit to make.

    #1100759
    Geoff
    Member

    Hi Audrey,

    Yes, please try adding the code I provided to that file where you would like the View More link to appear and that should do the trick.

    Thanks!
    Geoff

    #1100808
    audrey
    Participant

    Hi Geoff

    I made the edit and tried the new list-widget.php file. Still did not work.
    Here is the edited file code snippet –

    <p class="tribe-events-widget-link">
    		<a href="/events/list" rel="bookmark">
    		<?php printf( esc_html__( 'View All %s', 'the-events-calendar' ), $events_label_plural ); ?></a>
    	</p>
    #1101301
    audrey
    Participant

    Hi Geoff,

    I don’t think this is going to work for me. Any other suggestions before I give up on this?

    #1101307
    Geoff
    Member

    Hey Audrey,

    So sorry for the trouble with this!

    I’ve been able to make the change on my test site, so let’s start back at the beginning so I can outline how I did it.

    • Make a copy of the list-widget.php file. It’s located at /wp-content/plugins/events-pro/src/views/pro/widgets/list-widget.php
    • Make a new folder in your theme directory called tribe-events
    • Make a new folder in that one called pro
    • Make a new folder in that one called widgets
    • Drop the copied list-widget.php file into that last folder
    • Replace the code in the copied list-widget.php with this code
    • Save changes

    Following these steps did the trick for me. Do they work for you too?

    Thanks so much!
    Geoff

    #1101390
    audrey
    Participant

    Good news, it works!!

    The steps you gave me are a little different from what I was doing. Not sure how I got off track.

    Many thanks.

    #1101915
    Geoff
    Member

    Awesome! Nice work and so glad to hear that did the trick. I know customizations aren’t always easy, so high fives for getting it done. 🙂

    I’ll go ahead and close this thread but do please feel free to reach back out if any other questions pop up and we’d be happy to help.

    Cheers,
    Geoff

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘list-widget’ is closed to new replies.