Community Events Login VS Theme Login

Home Forums Calendar Products Community Events Community Events Login VS Theme Login

Viewing 15 posts - 1 through 15 (of 28 total)
  • Author
    Posts
  • #1063239
    Kevin
    Participant

    I have been having some issues with the user login/registration process. I just noticed that I am using my theme’s Login process instead of the Community Events login (http://www.dancingcircles.com/events/community/add). Is there a way to bypass the Community events login once the user is already logged in through my theme? I would much prefer to use the one offered by my theme (Kleo). No offence – but it is is bit nicer and has ability to login with several social media options. Once I login with my theme, i see my user profile no problem, but then going to my events page require another login process through Community Events login, which is extremely inefficient. it seems that the 2 login procedures are not connected.

    hope there’s an easy solution. thanks.

    #1063264
    Kevin
    Participant

    Perhaps a better way to phrase this would be if I could use my wp-login.php as the login instead of a the Community Events Default login process. they seem to be different. not sure if that clears it up a little better.

    thanks again.

    #1063788
    Nico
    Member

    Hi Kevin,

    Thanks for getting in touch! Interesting question here…

    Brian explained how this works very well in this thread: Login Page Template for Community Events. Please check that out and let me know if it makes sense to you. He refers to customizing the community template he refers to doing a template override as shown in our Themer’s guide.

    Please let me know about it,
    Best,
    Nico

    #1064720
    Kevin
    Participant

    Thanks for passing along this thread. Sounds like that’ll get me on the right track – but to start, what does it mean to “Add a check at the top of the community template”? I apologize if my beginnerness is showing.

    Thanks again.

    #1065800
    Nico
    Member

    Hi Kevin,

    Thanks for following-up!

    what does it mean to “Add a check at the top of the community template”? I apologize if my beginnerness is showing.

    No worries at all! I incorrectly assumed you could follow along, but let’s go slower!

    So the community template Brian refers to is the one located at ‘wp-content/plugins/the-events-calendar-community-events/src/views/community/edit-event.php’ (new events + edit events template), which you can override (as described in our themer’s guide. Once you have your own copy of the template you can add your custom login check + redirect at the top of the template. For example:


    ...
    if ( ! defined( 'ABSPATH' ) ) {
    die( '-1' );
    }

    // custom login redirect
    if ( !is_user_logged_in () ) {
    wp_safe_redirect( site_url( 'wp-login.php' ) );
    exit;
    }

    $events_label_singular = tribe_get_event_label_singular();
    ...

    Give this a try and please let me know if you still need help getting this in place,
    Have a great week,
    Nico

    #1065900
    Kevin
    Participant

    I edited the edit-event.php and copied it to the the folder …wp-content/themes/kleo-child/tribe-events/community – which, if I read the Themer’s Guide correctly is the right folder. However I see no change at all. I must have missed something. Currently, when I login to my site, I go through the Themes default login, but then when I select Add Event, I am redirected to the Events Calendar Login. Anything else i can try?

    #1066151
    Kevin
    Participant

    I also noticed that After The “Add Event” log-in the user is redirected to wp-admin wordpress dashboard.

    #1066381
    Nico
    Member

    Hi there Kevin,

    Thanks for following up on this! Let’s recap a bit to make sure we are on the same note…

    You are trying to redirect users to this login page, right? http://dancingcircles.com/wp-login.php – and once the are logged in they should be redirected to the ‘Add Event’ page?

    I also see that your site has a ‘pop-up’ login, Are you trying to implement that login form? In that case you’ll need to add the classes (or id) that make the pop-up work to the ‘Add Event’ link. Maybe you should contact the theme developer on that.

    Please let me know about it,
    Best,
    Nico

    #1066393
    Kevin
    Participant

    The link you sent was not the login I wanted to redirect to. My issue is that when a user who is already logged in (through my theme’s pop up login), they are not considered logged in on Events Calendar. but then that login process through this link http://www.dancingcircles.com/events/community/add automatically redirect users to the wp-admin dashboard not the actual Add Event Page.

    Ideally, by clicking the ADD EVENT link in the menu…

    1) Users already logged in through the theme-pop up login won’t have to login again to EC
    and
    2) Users NOT logged in through the theme pop-up login will see the pop-up login and then then be redirected to the Add-Event page.

    is this doable? Thanks again!

    #1067065
    Nico
    Member

    Hey Kevin,

    Thanks for clarifying this!

    1) Users already logged in through the theme-pop up login won’t have to login again to EC

    This depends on how the theme login works. If it uses standard WordPress auth then this shouldn’t happen. Can you point me to the theme documentation on this? If that’s not available maybe you can reach out to the theme author on this.

    2) Users NOT logged in through the theme pop-up login will see the pop-up login and then then be redirected to the Add-Event page.

    Knowing if the theme login works with default WordPress auth process will determine if this is doable as well. Per default WordPress login accepts a redirect parameter to redirect users after successful login, not sure if your theme login supports that.

    Please let me know if there’s any info on how the theme login works, or if you can reach out to the theme author on this,
    Best,
    Nico

    #1067086
    Kevin
    Participant

    I just connected with the theme support team and here is what they responded with:

    It uses the standard auth. Tell them you need to change their login link. It needs to have the ‘kleo-show-login’ class added to it. That’s what triggers the login modal.

    And here is the documentation on that:
    http://seventhqueen.com/support/documentation/kleo#login-redirect

    Please let me know what I can do. Thanks again!! Much appreciated.

    #1067852
    Nico
    Member

    Thanks for sending the info over!

    So you’ll need to add the class kleo-show-login to the ‘Add Event‘ menu item in the menu, check how to do so here: How to Add a Custom Class to a WordPress Menu Item. You’ll need to do so for all links to ‘Add Event‘ not just to the one in the menu.

    Not sure if the login pop-up will auto redirect the users to the link URL (don’t seem to be the case from what they state in their documentation) or you’ll need to add a login_redirect filter for that.

    Regarding peeps accessing the ‘Add Event’ URL directly, maybe we can add a script in the add event template to trigger the click event of the Add Event menu link. Please let me know if you can add the pop-up login class to the button in the menu, if that works we can go ahead and edit the add/edit event template!

    Please let me know about it,
    Thanks,
    Nico

    #1067875
    Kevin
    Participant

    Yes adding the kleo-show-login CSS class does bring up the pop-up login screen now – but after logging in, users are not redirected to the Add Event page. It just reloads the homepage. and then, even when I am logged in and select ‘ADD EVENT’, the login window pops up again. I have the theme option set to ‘Reload Current Page’ which i believe is correct. not sure how to add the login_redirect filter you referenced.

    thanks again for your help. please let me know the next steps i need to take.

    #1068458
    Nico
    Member

    Hey Kevin,

    Glad to hear you could get started with this 🙂

    The login_redirect hook basically let’s you filter/modify where users are redirected after login, so for example you could add the snippet below to your functions.php to redirect all users to the add event community page after login. There’s a more complex example on the codex, showing how to filter via user level, etc. For this to work it seems that you need to configure the redirection setting to ‘Default WordPress Redirect’.


    function redirect_to_ce( $redirect_to, $request, $user ) {
    return site_url('/events/community/add/');
    }

    add_filter( 'login_redirect', 'redirect_to_ce', 10, 3 );

    even when I am logged in and select ‘ADD EVENT’, the login window pops up again.

    I’m not sure about how that works in the theme. I guess it should send you to the link URL if you are in fact logged in. You’ll need to ping the theme support again I guess.

    So once you get that working we can move on to adding the JS code to the add/edit event template, so users that reach that URL directly won’t see the Community Events default login!

    Have a great weekend,
    Nico

    #1068474
    Kevin
    Participant

    I tried adding the snippet to my functions.php (in the Child Theme location) and nothing happened. I also changed the redirect setting to Default WordPress Redirect. Not sure if the location is correct or not.

    I have 2 Links on the menu. One is ADD EVENT and the other is LOGIN. By adding that redirect snippet, will it affect the redirect for LOGIN link as well? I would prefer only the ADD EVENT link to redirect to that page.

    I believe that the logged-in user being presented with the popup again is only because I added the kleo-show-login class. otherwise it redirects to the Events Calendar login as described above. I would like to avoid the user who is already logged in from seeing any login screen again. It should just go directly to the ADD EVENTS page. Is not not an Events Calendar Thing?

Viewing 15 posts - 1 through 15 (of 28 total)
  • The topic ‘Community Events Login VS Theme Login’ is closed to new replies.