Creating Home Page 'list' view vs Events Page 'list' view

Home Forums Calendar Products Events Calendar PRO Creating Home Page 'list' view vs Events Page 'list' view

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1177788
    Lucy
    Participant

    Hi there,

    I’ve been working with TEC Pro plugin for a couple days now and have been following along the Themer’s Guide https://theeventscalendar.com/knowledgebase/themers-guide/ to create custom templates.

    An issue I’ve currently run into though, is how to create a new view template. I need a ‘list’ view for the Home Page that varies slightly from the ‘list’ view on the Events Page. I’ve tried to create a duplicate of the list view with:

    /wp-content/themes/[my-theme]/tribe-events/home/ (including the same content as /list/)
    and
    /wp-content/themes/[my-theme]/tribe-events/home-list.php/

    with the shortcode [tribe_events view="home"] in my front-page.php to differentiate from list.php that the events page ‘Default view’ is set to. However, I’m not having any luck.

    Am I missing a step here/can this be done?

    Thanks for your help!

    #1178354
    Andras
    Keymaster

    Hi Lucy

    Thanks for going Pro and welcome to the forums! Let me help you with your question.

    I’m not quite sure the creating a home directory will work like that.

    If you would like your website’s home page to show a calendar, then create an empty page and put the shortcode in there. I can recommend this article for some further details:

    Set the Calendar as the Homepage

     

    Let me know if this helps or if you have any more questions.

    Cheers,
    Andras

    #1178471
    Lucy
    Participant

    Hi Andras,

    I already have the shortcode on my Home Page (myurl.com) – the problem is that it’s identical to the Events Page list (myurl.com/events/).

    I’d like these templates to be structured differently, so I’m wondering if I can create create a new view/list template?

    For example:
    On the Home Page list I want the event date to display: November 14
    On the Events Page list I want the event date to display: Monday, November 14th, 2016

    #1179107
    Andras
    Keymaster

    Hi Lucy,

    Achieving that would require customization work, which we are limited in supporting and currently our hands are full.

    What you can try is overriding the existing templates, like tribe-events/list.php and adding a conditionals like ‘if ( is_home() )’ to change the behavior based on where the view is embedded.

    If you need some expert help I can share with you this list of awesome people of the community who could help you out with this:

    https://theeventscalendar.com/knowledgebase/find-a-customizer/

    I hope this helps to get you started.

    Cheers,
    Andras

     

    #1179302
    Lucy
    Participant

    Hi Andras,

    Sounds good, for those following this thread:

    – I’m copying the contents of tribe-events/list/ into tribe-events/list.php and wrapping the duplicated content in a conditional (to adjust).

    <!-- Main Events Content - Home Page -->
    <?php if ( is_front_page() ) { ?>
      <?php tribe_get_template_part( 'list/content' ); ?>
    <?php } ?>
    
    <!-- Main Events Content - Custom Page -->
    <?php if ( !is_front_page() ) { ?>
      <!-- Duplicated contents of tribe-events/list/ to customize -->
    <?php } ?>

    Thanks!

    • This reply was modified 9 years, 6 months ago by Lucy.
    #1179830
    Andras
    Keymaster

    Hey Lucy,

    Thanks for sharing your solution here, much appreciated!

    Allow me to recommend a simplification:


    <!-- Main Events Content - Home Page -->
    <?php if ( is_front_page() ) {
    php tribe_get_template_part( 'list/content' );
    }
    // Main Events Content - Custom Page
    else {
    // Duplicated contents of tribe-events/list/ to customize
    } ?>

    Not much of a difference, but performance wise a bit better to have if … else … than if … if …

     

    Since this is marked resolved I am going to close this ticket, but if you need anything else related to this topic or another please post a new topic in the forum and we will help you out.

    Good luck with your project!

    Cheers,
    Andras

    PS: If you like our plugin, and you didn’t yet do so 🙂 we would be happy to receive a review in the wordpress.org repository. Thanks!
    https://wordpress.org/support/view/plugin-reviews/the-events-calendar

    PS2: We’d be also grateful if you would give us feedback on your satisfaction with support. Just click on one of the classy looking emojis below. 🙂 If you can spare a few words, that’s even better. Doublethanks!

     

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Creating Home Page 'list' view vs Events Page 'list' view’ is closed to new replies.