Hi, thanks for a great theme. As I am quite new to this theme I wonder what the best practice is for adding a register form in a site based on Umazel Starter Kit? BR Inge
if your question regards how to make that form another section on a content page (just like text or gallery sections), I can point out some things you may have to do. Otherwise you could implement it on a separate template following the example Alex mentioned.
First thanks to Alex Skrypnyk for a fast answer, I will certainly look at the example you mentioned.
As a answer to Sotirris my first though was to make a sections so if you please could show me what to think about and point out a way i would be pleased.
In order to make a section with the login and the register form, I'd start by creating two document types, each for one form (assuming that there will be two sections - one for login and one for registration).
See what compositions other section document types have and assign the same to your new doctypes.
Find the "Sections Folder" document in Document Types and on Permissions allow the two new doctypes you created to be added as children. Then you can add those to any page.
Then build the models DLL from the Developer section so you have access to strongly-typed models for your new doctypes (you may have to do this again should you add properties to those doctypes).
Create two partial views for your two doctypes - or, controllers and partials, whatever you think fits.
There is a file in /views/partials named PageSectionRenderer.cshtml. There you'll see that a partial view is invoked depending on the document type - add your two doctypes to the switch clause there invoking your newly-created partials. (Instead of a partial view, you may want to invoke a controller action here for login / registration).
If all goes well, your partial or action resulting in a partial will be rendered when you have one of your new doctypes in a page. Go on an add the login or register document to a page under "Page Elements" (that is the "Sections Folder" doctype) and see where it gets you.
You can also use NodeRestrict configuration to limit the number of login / register forms to 1 for each site root but I think I've confused you enough for a day :) It's complicated, I know, but you'll see that once you get the grasp of it it's pretty easy to extend the theme.
I followed your description above and created a new section for MemberRegister, and then tried to include the section in a contentpage, that was the easy part.
When I tried to run the application I get a error message that says that my model does not contain a definition of first name.
Register form in Umazel Starter Kit Theme
Hi, thanks for a great theme. As I am quite new to this theme I wonder what the best practice is for adding a register form in a site based on Umazel Starter Kit? BR Inge
Hi Inge
I think the best way to start is to use standard Umbraco Register form. Look at "\Umbraco\PartialViewMacros\Templates\RegisterMember.cshtml"
Its great example.
Thanks,
Alex
Inge,
if your question regards how to make that form another section on a content page (just like text or gallery sections), I can point out some things you may have to do. Otherwise you could implement it on a separate template following the example Alex mentioned.
Hi,
First thanks to Alex Skrypnyk for a fast answer, I will certainly look at the example you mentioned.
As a answer to Sotirris my first though was to make a sections so if you please could show me what to think about and point out a way i would be pleased.
Hope you all get a nice weekend. BR Inge
Hi Inge
Have a nice weekend too!!! We are helping with pleasure
Alex
In order to make a section with the login and the register form, I'd start by creating two document types, each for one form (assuming that there will be two sections - one for login and one for registration).
See what compositions other section document types have and assign the same to your new doctypes.
Find the "Sections Folder" document in Document Types and on Permissions allow the two new doctypes you created to be added as children. Then you can add those to any page.
Then build the models DLL from the Developer section so you have access to strongly-typed models for your new doctypes (you may have to do this again should you add properties to those doctypes).
Create two partial views for your two doctypes - or, controllers and partials, whatever you think fits.
There is a file in /views/partials named PageSectionRenderer.cshtml. There you'll see that a partial view is invoked depending on the document type - add your two doctypes to the switch clause there invoking your newly-created partials. (Instead of a partial view, you may want to invoke a controller action here for login / registration).
If all goes well, your partial or action resulting in a partial will be rendered when you have one of your new doctypes in a page. Go on an add the login or register document to a page under "Page Elements" (that is the "Sections Folder" doctype) and see where it gets you.
You can also use NodeRestrict configuration to limit the number of login / register forms to 1 for each site root but I think I've confused you enough for a day :) It's complicated, I know, but you'll see that once you get the grasp of it it's pretty easy to extend the theme.
Hi Sotiris,
Thanks for your answer, must say that it is a bit confusing :), I certainly will try to dive deeper in extending the theme but not now.
I have started to add normal pages to the site without sections and in these pages I added a Html.Action
It shows up right when looking at the page except styling, so now I wonder which Template is best to use in order to embed the Register on the site.
BR Inge
Hi again Sotiris,
I followed your description above and created a new section for MemberRegister, and then tried to include the section in a contentpage, that was the easy part.
When I tried to run the application I get a error message that says that my model does not contain a definition of first name.
Please do you have any clue what this is about?
Regards Inge
Here are more information in this topic it seems that I use wrong model type?
is working on a reply...