Need template help with list/loop.php

Home Forums Calendar Products Events Calendar PRO Need template help with list/loop.php

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1489706
    alliances
    Participant

    HI we are showing the list/loop.php on one page with some customizations that work when we are showing a particular event category.

    BUT, we need to basically duplicate the /loop/single-event so that we can customize it for a different page with all events.

    so we want to show the event loop in list form, but on one page the single-events.php needs to be a different template so we can customize it separately.

    Basically, the php in the single-events.php is customized for one page, but we basically then need to dupe the template so we can show it a different way, just basically make it look different, on another page.

    We have to change the php, so just doing css worn’t cut it.

    what is the best way to create a second /list/loop.php and list/single-event.php so we can customize one for one page, and one for another.?

    No change in the event data. just can’t achieve the difference with CSS.

    so we’re adapting the list to look both ways, but can’t just achieve with css.
    We need basically a second single-event.php to customize how the list looks on a second page.

    #1490921
    Sky
    Keymaster

    Hi there!

    While we are limited in the amount of support we can provide for customizations such as this, I will try to help get you pointed in the right direction.

    This is the approach I would take. Duplicate the single-events.php file into tribe-events in your child theme. For more information on using custom templates, see this knowledgebase article.

    Then, use one or more conditionals to create the two variations you wish to see.

    For example:


    if( tribe_is_event('345') ) {
    // do this
    }
    else {
    // or do this
    }

    Let me know if that helps, or if you have any other questions.

    Thanks,
    Sky

    #1492343
    alliances
    Participant

    Hi that’s perfect,
    however just to clarify does the 345 correspond to the event id?
    How could I say if the shortcode appears on page id x then apply this template instead. is that possible?

    basically we are applying this to the new calendar page so
    we can say — if the page, or the page id where the shortcode appears is 345 then use this template.

    Sorry just need clarification — so we use the same shortcode, but the conditional will see that the page id is 345?

    #1492765
    Sky
    Keymaster

    Hello again,

    I just used that conditional as an example, but yes, the ‘345’ would correspond to the post id in the ‘tribe_is_event’ function. You can read more about this function in our documentation.

    The example I provided should do exactly what you are asking if you use the correct post ID and add the code within the correct if/else curly brackets.

    Let me know if you have any other questions.

    Thanks,
    Sky

    #1512900
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Need template help with list/loop.php’ is closed to new replies.