WordPress.org

Ready to get started?Download WordPress

Forums

Profile Builder - front-end user registration, login and edit profile
[resolved] Register / Login in modal (AJAX) dialog? (4 posts)

  1. AngryGerman
    Member
    Posted 2 months ago #

    Is it possible to use the login and registration features of Profile Builder inside a modal dialog, instead of on a separately-loaded page?

    I would like to use a JS-driven login / register button on my pages, which, when clicked, opens a modal dialog with the login / registration forms inside, and which then reloads the page (or redirects to a specified page) from there, rather than showing the login/register forms on their own separate pages.

    If so, how would I get this to work?

    Thanks!

    https://wordpress.org/plugins/profile-builder/

  2. sareiodata
    Member
    Plugin Contributor

    Posted 2 months ago #

    It can work.

    - create a page template without header or footer.
    - create a login page with that page template that has the [wppb-login] shortcode.
    - open that page in a modal window of your choice.

    Notes. If you log in in the modal and then close it, it won't reflect in the page that initiated the modal because you logged in a different page. So you'll want to do a page reload on modal close. (can be done via configuring the modal or writing a bit of code)

    Alternatively, you can use the Profile Builder widget or the shortcode inside a text widget, if you don't want a stand alone page.

  3. AngryGerman
    Member
    Posted 2 months ago #

    Thanks for the quick response.

    In that case, how would I ensure that the page doesn't get reloaded when the user enters an incorrect password when signing in, for example?

    As it stands, it seems that the login page gets loaded in the modal window, and then the page reloads no matter what, when the user clicks "log in" - even if the password is wrong.

  4. sareiodata
    Member
    Plugin Contributor

    Posted 1 month ago #

    You won't have that problem because it page will reload inside the iframe of the modal.

    And then, theoretically, you can connect to the close modal trigger, check via javascript if the auth cookie is present and then reload the main page (not the page in the modal iframe).

    Hope this makes sense.

Reply

You must log in to post.

About this Plugin

About this Topic