Jump to content

SOLVED: LOGIN/REGISTER/PROFILE - LoginRegister - Show RegisterForm


DV-JF
 Share

Recommended Posts

Hi, is it possible to show the registration form directly instead of having the login form?

I want to use the registration Form for a call-to-action section, so I'll need the form to be displayed without having to link to another site.

I'll already tried to hook into __execute() but without any success.
 

Many greets.

Edited by DV-JF
Problem solved
Link to comment
Share on other sites

The module looks for a GET parameter register. When this is set to 1, it renders the login form.

So what you could do is in the temnplate where you render the login form

// set GET parameter register to 1
$input->get->register = 1;
// render the form
$content = $modules->get('LoginRegister')->execute();

I just tried it and it seems to work.

  • Like 5
Link to comment
Share on other sites

  • 3 weeks later...

If I want to show both in the same page, how I can do? 

I tried to make an array  like this  $input->get->["register, login"]  = 1  But yes I know it's wrong.

UPDATE:

Ok I have fund the solution in this way: 

<div>
<!-- The Modal -->
  <?php
    $loginRegister = $modules->get('LoginRegister');
    $out = '';

    if(!$config->ajax) { // if not ajax, show markup
        $out .= '
              <div>
                <!-- The Modal -->
                <div id="myModal" class="modal">
                    <!-- Modal content -->
                    <div class="modal-content">
                        <span class="close">×</span>
                        <div id="LoginRegisterDiv">';
    }
    // call the module LoginRegister
    $out .= $loginRegister->execute(); // this render the login form

        if(!$config->ajax){
          $out .= '<div>';
        }

          $input->get->register = 1;
          $out .= $loginRegister->execute(); // this render the register from 

        if(!$config->ajax){
          $out .= '<div>';
        }

    if(!$config->ajax) { // if not ajax, show markup
        $out .= '    </div>
                </div>
            </div>
          </div>';
    }

    $content = $out; // delayed output
    // or
    echo $out; // direct output
  ?>
</div>

 

I load the form inside a modale box, for this there are more code. But the focus still is in creating two different separate renderings.

 

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...