Custom Registration Form

Hi

I'm writing a plugin for my site which has a default access to logged in users only. I have changed the login screen to my needs but have been unable to change the Register form. 

The problem I have is:

A) while I can change the fields and body of the form (elgg/mod/myplugin/views/default/forms/register.php), I can't get rid off the peripheral HTML (headers, CSS, JS, etc) that Elgg wants to insert. What I'd really like is a blank page that I can customise as required.

B) if I register a page handler for mysite/elgg/register, it does not overwrite the Elgg default and I am diverted to the standard Elgg registration page

C) if I try and register my own page handler, say mysite/elgg/myplugin/registration, I can't get access to the form as the user is not logged in yet.!

 

Anyhelp would be greatly appreciated. 

 

  • A) Those are in other views which you can extend and/or overwrite if necessary, but if you want to customize the entire page as a blank canvas then...

    B) You need to unregister the pagehandler first, and then re-register it to use your handler

    C) If you want it to be public make sure you're not using any of the gatekeeper functions

  • Thank you Matt. How do I determine the name of the current page handler that is managing the Registration at the moment?

     

    Also, should I be registering the following hook handler and managing display that way?

     

    elgg_register_plugin_hook_handler('register', 'user', 'my_Function_to_display_custom_registration_page'

  • The current page handler is the part of the url after your site root.  It's in the format of:

    example.tld/handler/arg1/arg2/arg3/etc

    So for example the handler of this page we're on right now is 'discussion'

     

    The plugin hook you're using there triggers after a user has registered, it's not appropriate for modifying anything public.

    elgg_unregister_page_handler('register');

    elgg_register_page_handler('register', 'my_registration_page');

     

    function my_registration_page($page){

        // now you can control your page output

    }

  • Hi Matt,

     

    Youre a champ. That worsed a treat. Thank you very much

     

    Where do you scuba dive? I'minn Sydney and have dived here and a few other places

     

    Egypt

    Philippines

    Thailand

    Fiji

    Mozambique

    Zanzibar

    Lake Malawi

    Perth

    Great Barrier Reef

    Yadda yaddaa!

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking