Changing default view based on viewport size?

Home Forums Calendar Products Events Calendar PRO Changing default view based on viewport size?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #50796
    Nicholas Rios
    Participant

    Problem: In the settings there is the option to change the default view of the Events to either the calendar or the Event list. I am looking for where/how this change is being made so I can hook onto it and make it load only the list view when using a smaller viewport.

    I’m afraid this is probably very simple, and I’m simply just missing it.

    Reason: The table display for calendar view looks nice, but is not responsive. I would like to default to that view for larger viewports, but not smaller ones. If there is a different way to approach this please let me know. I just checked and now see that it is the top voted new feature for 3.0, but I just want to know where to get started and I can code it.

    #50829
    Jonah
    Participant

    Hi Nick,

    I don’t think this will be possible without some fairly heavy duty hacking because of how this affect affects the views. Essentially what it does now is rewrites the URL depending on the value and this is all done behind the scenes, and I don’t think there’s a way to hook into this action to be able to change the rewriting based upon some other parameter like viewport. But maybe this will help… You can get the value of this option via the echo tribe_get_option(‘viewOption’); and if you do a code search for ‘viewOption’ you can see some of the rewrite code and perhaps you can figure out how to do what you’re looking to do.

    I hope that helps!

    – Jonah

    #50919
    Nicholas Rios
    Participant

    Thanks a lot Jonah, about to dig in now.

    #51063
    Jonah
    Participant

    Sounds good Nick, if you come up with any solutions, please do share them here!

    Thanks,
    Jonah

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Changing default view based on viewport size?’ is closed to new replies.