Gridview Based On Category

Home Forums Calendar Products Events Calendar PRO Gridview Based On Category

Viewing 15 posts - 16 through 30 (of 35 total)
  • Author
    Posts
  • #18258
    Jonah
    Participant

    Hi Diane,

    What I posted on 4/10 is that basically all your event category specific calendars are already there and available at http://your-url.com/events-slug/category/your-category-name/ (as long as you are showing the grid view by default).

    So, I’m not sure what else you need to do with those four templates for the non-active categories. Delete them?

    I guess I’m confused about the question… Can you elaborate/provide some examples that I can maybe look at?

    #18259
    rudeetours
    Member

    Jonah,
    If you look here http://rudeetours.com/ and scroll over tours, you’ll see the four categories. Each category has a different page template started by the other developer but not coded for the categories, just the page layout. So, I need to know how to include just one specific category (or how to exclude the other three.
    It’s possible I’m making this too difficult. Is there another way to get the desired results?

    #18260
    Jonah
    Participant

    Hi Diane,

    Well, if you want to stick with that permalink structure, yes, you’ll have to use the separate pages but you could just use one page template and pass in the slug or something to a custom calendar query.

    Otherwise, the easier approach would be to just use the build in category links and update the menu links for each of the tours to point to those category calendars. But, you won’t have nice URL’s then…

    The former option is going to be tricky thought but basically you should be able to include the gridview conditionallly like so into your pages:

    if(is_page('sample-page')) {
    include( get_stylesheet_directory() . '/events/gridview.php');
    }

    And then you could use the pre_get_posts function to conditionally modify the query for each page. The only downside to this approach is that the calendar prev/next links are going to take you outside of your specific tour pages and back into the main calendar page, showing the previous or next month with all categories… Unfortunately there’s no easy way around this that I know of so you’ll need to play around with things to get it working right.

    Another thing you could try is making your base events slug ‘tours’ and then instead of displaying the calendar on the ‘tours’ page, display your tour landing page and then for all your event sub-categories they will use ‘tours’ as the slug base so your URL’s will look more like they do now. But you’ll still have /tours/category/category-name (the category base in the slug) and I don’t know of any way to easily get rid of that either…

    So, those are some options and you’ll need to play around with things a bit to get them working the way you want. Hopefully these ideas help though! Good luck!

    #18271
    rudeetours
    Member

    Given your comments above, maybe it’s easier to just start over using your default category display page. However, the category templates that I need to reproduce have different content before the calendar. I see in settings > the events calendar > template that I can add html before the calendar. I would like to be able to add conditional php code so I could display different content depending on my category. It doesn’t look like I can use php there. Any ideas on how I can do this?

    #18536
    Jonah
    Participant

    All you’ve got to do is put conditional code in /wp-content/plugins/the-events-calendar/views/gridview.php (override by placing a copy in an ‘events’ folder in your theme) to detect the category which is just a taxonomy. Gridview is the template used to display your calendar page. You should be able to use if(is_tax(‘tribe_events_cat’,’your-cat-slug-or-ID’)) {}

    I hope that helps!

    #19194
    rudeetours
    Member

    Jonah, I’m able now to turn my focus back to this project. The good news is that using your conditional statement(s) in gridview.php I was able to display different content before and after the calendar for my different categories. The bad news is that my category filtered calendars don’t seem to be working for some reason. I have four categories that should display on these four pages respectively.
    http://rudeetours.com/events/category/creek-cruise-2/
    http://rudeetours.com/events/category/dolphin-watching-2/
    http://rudeetours.com/events/category/seabreeze-cruise-2/
    http://rudeetours.com/events/category/winter-wildlife-2/
    But, if you see the test events I’ve created, it shows that somehow those categories aren’t being filtered properly.
    Any ideas as to why or what I can do to resolve this?

    #19196
    rudeetours
    Member

    Also, (assuming my categories were working), when I page to the previous month or next month, I exit my category and just go to /events/2012-04 for example. From your comments, I understood that if I used your category pages, the previous and next functionality would also reflect the category. Did I misunderstand this?
    Thanks in advance for your help!

    #19232
    Rob
    Member

    Thanks rudeetours. I’ve passed sent this Jonah’s way to make sure he sees it (the email notifications have been buggy lately) and he should be taking a look shortly.

    #19272
    rudeetours
    Member

    Thanks. I got it to work by going back to the basic grid.php. However, I lose my sidebars. Any idea why?

    #19283
    Rob
    Member

    Rudeetours: could you bring back the sidebars with a different templating option selected under Settings -> The Events Calendar?

    #19312
    rudeetours
    Member

    No, I can’t get the sidebar with the calendar with any of those options.

    #19353
    Jonah
    Participant

    Hi there,

    Make sure events are associated with any of those 4 categories, for instance I looked at this event: http://rudeetours.com/event/dolphin-test/2012-05-15/ – and it didn’t appear to be associated with the Creek Cruise category…

    I did mention the prev/next links:
    “The only downside to this approach is that the calendar prev/next links are going to take you outside of your specific tour pages and back into the main calendar page, showing the previous or next month with all categories… Unfortunately there’s no easy way around this that I know of so you’ll need to play around with things to get it working right.”

    On the sidebar issue this is more related to your theme and how it inserts sidebars. Depending on what Events Template you have set, you’ll want to go into that template and add the sidebar however your theme adds sidebars. You’ll need to change the layout via CSS specifically for that page.

    Good luck!

    #19381
    rudeetours
    Member

    Ok, Thanks. Most events are not categorized yet as this site is live. Once I get the categories working, we’ll update the events. I do have test events out there that are categorized for testing purposes.

    I’m going to try and display the sidebar differently using widget logic. I’m having trouble figuring out which conditional statements might work as it doesn’t really recognize the “events categories” as true “post categories”. Can you tell me how I can set up my conditional statements to target my events categories?
    Thanks again!

    #19440
    Jonah
    Participant

    Here’s a few different conditional wrappers that should help give you some ideas: https://gist.github.com/2415009

    Event categories are taxonomies so you would just need to pass in the taxonomy name into the is_tax function to test for specific cats.

    Good luck!

    #19472
    rudeetours
    Member

    Jonah,
    When I view the page source for the gridview.php category pages I see that the taxonomy is “tribe_events_cat”, but I don’t see how to differentiate between the categories.

Viewing 15 posts - 16 through 30 (of 35 total)
  • The topic ‘Gridview Based On Category’ is closed to new replies.