Photos View Navigation

Home Forums Calendar Products Events Calendar PRO Photos View Navigation

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #551157
    aling
    Participant

    Hello!

    I’m playing around with the photos view on my localhost. I’m taking one of our ExpressionEngine site and converting it into WP.

    I was able to mimic this design using the photos view: http://hazelasvegas.com/events

    My problem is the navigation piece.

    How can I go about separating the “past” events from the “current” events?
    Right now it just keeps showing, past events and next events and each time I click on it, I either get the next set of current events or I keep clicking until I get to the past events. I think that would be too confusing for people.

    1. Is there a way to create another page similar to the site I linked above where there is an “archived” section.

    2. Is there a way to remove the navigation on the main events page wo it affecting the “past” events page?

    #557977
    Casey D
    Member

    Hello aling,

    Thanks for contacting us! I think I mostly understand your question, but may need some more information.

    The main link you’re looking for is /events/past/. That will display all events that are ‘archived’.

    Otherwise, there isn’t a clear distinction in the code base to separate a ‘past’ event from a ‘current’ one. If a user wants to keeping navigating back, they will seamlessly run into ‘past’ events as it is one large calendar.

    Off the top of my head, maybe you could add a ‘past event’ tag to old events, and change the main tribe_get_events() query to ignore that tag. Does that make sense?

    Also, <i>maybe </i>you could implement a js solution that hides events and/or nav if those events/nav is before the current day? Just spitballing here.

    Otherwise I’m not sure of easy ways to implement what you currently have out of the box.

    Let me know if I can help with anything else, of if this doesn’t answer your question!

    Cheers!

    – Casey Driscoll

    #560380
    aling
    Participant

    So instead, I ended up adjusting the nav piece saying if the date of the event is past todays date, change the copy to say “View Past Events” and vice versa.

    I have 15 events set for each page. My problem now is that, when I go to events page, even though I only have 9 events listed, the navigation piece keeps showing “Next Events” when there is none. How do I write it, so that the navigation doesn’t display if there are no more events?

    Here is what I have. I took out the a tag so that the code would display nicely on here.

    
        <?php $id=get_the_ID();
    		date_default_timezone_set('America/Los_Angeles');
    		$todayDate = date("Y-m-d H:i:s");
    		$eventDate=get_post_meta($id,'_EventEndDate', "Y-m-d H:i:s");
    	?>
        <?php if($eventDate >= $todayDate) :?>
    		<li class="tribe-events-nav-previous"><?php _e( '<span>«</span> View Past Events', 'tribe-events-calendar-pro' ) ?>
        <?php else : ?>
        	<li class="tribe-events-nav-previous"><?php _e( '<span>«</span> Previous Events', 'tribe-events-calendar-pro' ) ?>
        <?php endif;?>
        
        
        
    	<!-- Display Next Page Navigation -->
        <?php if($eventDate <= $todayDate) :?>
            <li class="tribe-events-nav-next">
                <?php _e( 'View Current Events <span>»</span>', 'tribe-events-calendar-pro' ) ?>
            <!-- .tribe-events-nav-next -->
        <?php else : ?>
        	<li class="tribe-events-nav-next">
                <?php _e( 'Next Events <span>»</span>', 'tribe-events-calendar-pro' ) ?>
            
        <?php endif;?>
    
    #577919
    Casey D
    Member

    Hello aling,

    I’m not sure I could write the code directly, as this is just a snippet and I’m not all sure about the environment or context.

    However (if I understand the problem correctly), what you need to do is change the last ‘else:’ into an ‘elseif:’ with the added conditional if there are events left. Right now you are just dumping out a ‘Next Events’ under every circumstance, even if there aren’t any events left in the future.

    I’m not sure exactly how you would check that (my guy says have_posts() is the way) but there may be another pagination function to test how many pages there are.

    Does this make sense? Let me know if this doesn’t work for you.

    Cheers!

    – Casey Driscoll

    #579463
    aling
    Participant

    Got it. I will try that out when I get back on the project sometime today. Thank you!

    #581526
    aling
    Participant

    Okies, I think I will keep it simple and just remove the next/prev options. Instead I just added my own button of calendar view and past events.

    My question about that is, when I’m on the past events page, it still shows “past events” and “calendar view” buttons. I would I be able to do an if statement based on if the page I’m on is displaying past events?

    I wanted to write something like, if events being displayed/url == past, show only calendar view button, else show both button.

    #591281
    Casey D
    Member

    Hello aling,

    Unfortunately this level of customization is starting to go beyond the scope of the forums (and my expertise). I’ll offer what tips I can though!

    I believe the conditional you want is tribe_is_past(). You can read more about it here: http://docs.tri.be/Events-Calendar/function-tribe_is_past.html

    Let me know if that doesn’t help, and I’ll see if we can cook something else up.

    Cheers!

    – Casey Driscoll

    #597800
    aling
    Participant

    Thanks Casey!
    That helped! It was only a simple if else statement. Thank you very much!!

    #615806
    Casey D
    Member

    Hello aling,

    Happy it worked out!

    We’d love it if you would leave us a review and let people know how much you like the plugin! http://m.tri.be/jt

    I’ll go ahead and close this thread. Let us know if we can help with anything else.

    – Casey Driscoll

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Photos View Navigation’ is closed to new replies.