Hello guys!
Im new to Elgg but have been doing web development with php/js/html/css for 7+ years. Im trying to make a plugin that in user registration asks for the users zip code and after checking if it is one of our valid zip codes it allows them to register; otherwise it denies them access.
Ive looked through some existing plugins that add fields trying to get the basics of changing the registration page but to no avail. I have a copied the vendor actions/register.php and views/forms/register.php and added an input in both places but do not understand the start.php registration of a custom register page. I tried reading the docs on this and it was hard to grasp. Maybe I just need to take a break for a bit but any help would be much appreciated!
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 1 like
- Dankworth@Dankworth
Dankworth - 0 likes
- Dankworth@Dankworth
Dankworth - 0 likes
- ihayredinov@ihayredinov
ihayredinov - 0 likes
You must log in to post replies.Look at elgg_user_account_page_handler() to override it with your custom function.
Also, you can try Profile manager plugin which included the validation and custom forms already (use latest release on GitHub).
@RvR Thanks for the response!
That makes sense - the only thing im missing now is how to call the view I have in my plugins views/default/forms/register.php instead of "echo elgg_view_resource("account/register");" I don't see how account/register is pointing to their views/default/forms/register.
If Im missing some overarching concept apologies, but Im new!
Also I was originally looking into Profile Manager - maybe ill give it another try but it didn't seem to allow me to make custom validation.
elgg_view_resource() grabs the view from "resources/<resrouce>", that in turns calls elgg_view_form(), which grabs the view from "forms/<form>".
You can extend the register form using elgg_extend_view(). If you are overriding the view in your plugin, make sure to flush the system cache.