• Resolved iRolfpro

    (@irolfpro)


    first of all, I’d like to say that I love this plugin and the theming/templating functionality!
    thank you!

    my problem, given in the title, is, that tribe_is_showing_all does not match for all, when requesting all the events, ’cause the value of $tribe_ecp shows: [displaying] => list

    to be more precise: I’ve got several events with different categories. choosing one of the cats I got a list. here I would expect tribe_ecp->displaying as “list”.
    but if I use the “show all events” link tribe_ecp-displaying still is set to “list”.

    can you give me a hand?

    thanks in advanced!
    rolf

    https://www.ads-software.com/plugins/the-events-calendar/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter iRolfpro

    (@irolfpro)

    oh, I’ve forgot sth. that might be another issue/question:
    when listing “all the events” I wasn’t able to figure out which catgories are involved in this list because
    $cats = get_the_terms( get_the_ID(), 'tribe_events_cat' );
    only delivers the category of the first event with the correct amount of ocurrences of that cat in the hole list – but ignoring the other categories of the other events.

    Thread Starter iRolfpro

    (@irolfpro)

    third input for this thing:
    if there are no (0) events for a category I get “all” == true

    Barry

    (@barryhughes-1)

    Hi @irolfpro!

    tribe_is_showing_all() is actually intended for use with Events Calendar PRO.

    It’s inclusion within The Events Calendar itself is probably a little confusing, and we plan to resolve that by moving it across to the PRO codebase in a future release.

    In the interim, unless you are indeed using Events Calendar PRO, I’d recommend switching away from it as the results may be unexpected as you have found.

    Thread Starter iRolfpro

    (@irolfpro)

    hi Barry,
    thank you for your reply.
    I understand the sadly news about tribe_is_showing_all(). that sucks a bit, but I could imagine that there is a need to divide the pro from free.

    but… what is with the categories list? is there a “free way” of getting to know that there multiple categories in the “all”-stream ?

    cheers,
    rolf

    Barry

    (@barryhughes-1)

    Hi Rolf,

    If I’m understanding you correctly you would need to write some custom code to do this and, just to be clear, even if you were using Events Calendar PRO I suspect tribe_is_showing_all() still would not meet your needs (it’s used to ascertain if the special all recurring events view is being displayed and has no connection with event categories).

    It sounds like you want to determine if a query returned events from more than just one category: to do this, you would need to inspect each result and figure out what (if any) categories it belongs to and go from there. I’m afraid, though, that custom dev tasks like this are beyond what we can help with.

    Even so, I hope that clarifies things and if you do craft a solution you’d like to share with others in the community it would be great to hear back from you!

    Thanks again ??

    Thread Starter iRolfpro

    (@irolfpro)

    okay, maybe tribe_is_showing_all() wasn’t the brightest idea.
    for sure there might be a bit of dev thinking, ’cause I didn’t find a doc or a function that helped me to fit my needs.

    let’s assume, I want to figure out if I’m, or the user, is viewing a list of _all_ events, to make it easier; to create a headline that doesn’t yield the first category but says: “hi guys, you’re watching a list displaying all kinds of events we offer”.

    is the solution given above, really the only way to iterate through all listed events and check if there are different categories to _assume_ I’m on the overview/starting point of The Events Calendar in my site?

    thank you!

    Barry

    (@barryhughes-1)

    No, it’s not the only way: assuming this list of events was ultimately created with a regular WP_Query (and that would include our own default list view) you could also examine various query vars and figure things out that way.

    There are probably a few other ways to approach the problem, too, but this is very much custom development territory and beyond what we can help you with here.

    Good luck!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘tribe_is_showing_all does not match 'all' but 'list'’ is closed to new replies.