Calendar view

Home Forums Calendar Products Events Calendar PRO Calendar view

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #13694
    Andrzej
    Member

    Hi guys,
    Is it possible to implement calendar view on the specific page? let’s say localhost/events/event-calendar.
    I’ve created template for this page, so I see the calendar. The problem is with the dropdowns and previous/next month.
    in calendar.php i found:
    $output = $tribe_ecp->getLink( ‘month’, $tribe_ecp->previousMonth( tribe_get_month_view_date() ));
    and in the-event-calendar.class.php I found:
    case ‘month’: return esc_url($eventUrl . $secondary);

    I’ve tried to put link insted $eventUrl, but then I’m getting: page not exist.

    Is it possible to fix that?

    #13736
    Rob
    Member

    Hey Andrzej. Thanks for the note; unfortunately I don’t quite understand what you’re aiming to do here so I can’t offer up much. Can you elaborate? Are the dropdowns not appearing, or functioning correctly? If you could post a screenshot of what you’re seeing (it sounds like this is being done locally so there’s no live site to point us to), it’d definitely be helpful. I can respond and can bring a dev in as needed from there.

    #13777
    Andrzej
    Member

    Hi Rob, I’m trying to put calendar view to specific page created by me. I have copied gridview.php to my new template and apply it to my created page. So I see calendar and navigation for it (previus month, next month and drop downs). But when I use them they redirect me to the original calendar page. What I want to do that then you using drop downs or previus/next month links it will stay on my page and just switch the month.

    #13791
    Andrzej
    Member

    And sorry for my english 🙂

    #13795
    Andrzej
    Member

    let say I will pass year and month through url (‘../myPage/?2012-02’)and somehow will force it to show February on the same ‘myPage’ page.

    The reason why I’m trying to do this is to hide event calendar for users who are not loged in.

    #13850
    Rob
    Member

    Thanks for the follow-ups, Andrzej. I understand what you’re saying now. While I don’t have an answer for you off-hand, let me see if our dev Jonah has any suggestions. I’ve asked him to respond here directly.

    #13950
    Rob
    Member

    Hi there Andrzej. Just a heads up that I reviewed this yesterday with our dev Jonah, and we’re going to bring another member of the dev team in to try and figure out what’s up. Apologies for the delay thus far, hopefully we can get you a response here today.

    #14043
    Joey Kudish
    Member

    Hey Andrzej,

    I’m a developer on the team here, and happy to help out 🙂

    Is there a particular reason why you would want to duplicate the calendar view on a separate page? Are you just trying to change the location of the events page? If so, there is a setting in Settings > The Events Calendar that allows you to change the slug of the main events page.

    While I understand what you are trying to do, it does sound like there may be a better way to do it then what you are currently doing. If you explain in more details what your end goal (as opposed to your specific approach), I may be able to bring a better solution to the table.

    As for the dropdowns, they are not designed to be used outside of the main events page, so they will not work the way you want them to without some modification or custom development.

    Like I said, let us know what it is your end goal is and we can help you find the best solution or at least point you in the right direction.

    Cheers,
    Joey

    #14059
    Andrzej
    Member

    Hi Joey,
    We are trying to block event calendar for persons who are not logged in to the wordpress, because we have confidential information there. List and single views we already done. So we create the page and give permissions only for group of people which needs to use it.
    Single view was sorted by passing ID of event via url and in Wp_Query we just add: ‘page_id’ => $currentID where $currentID = id is from url. Basically I thought maybe it is somehow possible to do for grid view as well.
    But maybe it is possible to block it other way, maybe you have another solution?

    Regards

    #14117
    Joey Kudish
    Member

    Hey Andrzej,

    If I understand correctly you would like to prevent non-logged in users from seeing the any event related pages, is that right?

    If that’s the case you are overcomplicating yourself. You don’t need to overwrite the template files or make new custom ones. You simple need to find the right hook within WordPress, check if the user is on an event page, and if yes, check if they are logged in.

    I wrote a quick function that will do exactly that. For your convenience I’ve pasted the code here: https://gist.github.com/1678347 and also made it available as a plugin, that you can download and put in your plugins folder, grab the zip from here: http://f.jkudi.sh/Dela

    This code hook into the parse_request WordPress hook and determines if the page being viewed is an Events Calendar page; if yes and the user isn’t logged in, it redirects them to the login url. Once logged in they will be redirected back to the page they came from.

    Feel free to change the code as needed (for example if you want to take them to a different URL) or move it to your own plugin or theme as needed.

    Please note that the code is provided as is, without any guarantee. I tested it with a few limited scenarios before giving it to you, but it’s not an official solution to having events restricted to logged in users. I think it should work in all scenarios, but use it at your own risk, and please understand that this beyond what we usually offer as support, but the solution was quick enough that I said why not 🙂

    Let me know if you have any questions or if I misunderstood the request and got something wrong 🙂

    #14243
    Andrzej
    Member

    Hi Joey, thanks for your solution. But that is not what I want. Basically we need not only hide calendar from not logged in users but and from different groups of users.
    I found the solution. I have created my own drop downs which passing the year and month via url “…/?date=2011-11”.
    and in table.php:


    $curDate=makeSafe($_GET[date]);
    $startDate = $curDate . ‘-01’;
    $endDate = $curDate . ‘-31’;

    $eventPosts = tribe_get_events(array( ‘eventDisplay’=>’all’, ‘start_date’ => $startDate, ‘end_date’ => $endDate ));

    And swap $tribe_ecp->date to $curDate and I’m sorted.

    Now I can do whatever I want with this page, block it for all users or just for one group and etc.
    Thanks for you help 🙂

    #14258
    Rob
    Member

    Excellent to see you got this figured out, Andrzej 🙂 This thread will certainly be useful for other users who have a similar request down the road. Let us know if we can do anything else for you.

    #14277
    Joey Kudish
    Member

    Ah, apologies for misunderstanding the request. Glad you figured out! As rob mentioned, let us know if you have further questions!

    Cheers

    #21961
    Kelli
    Participant

    Joey, Thank you for the code above. That’s exactly what I needed for my project and it worked perfectly.

    #21988
    Joyce Grace
    Member

    Glad it worked for you Kelli!

Viewing 15 posts - 1 through 15 (of 16 total)
  • The topic ‘Calendar view’ is closed to new replies.