Displaying membership tabs for customer logedin editing
I am using Umbraco cloud and using the EditMembershipForms.cshtml partial to display the membership details for members to edit. I have created a membership type "active members" and a couple of tabs "Practice details" and "General details".
Currently the EditMembershipForms.cshtml displays the whole form. How do I display by tab, so just the fields in each tab are displayed for customer editing?
Its a little unclear how you are writing out the form based on the information you have provided. Would you be able to share more information about the code that's in the view you refer to?
I'm going to assume that there is some code in there that is looping over all of the properties that have been marked as editable on the Member Type you have defined. I would not expect this to pull in the tabs from Umbraco since they are normally only used for the UI within Umbraco its self. If you want to group the properties then I believe you would have two possible solutions.
The first is to hand code the form and group the properties manually, this would give you more control over the look of the form. The second option is to pull in the tab information from Umbraco and then use that information to write out the form. Something like the below would be along the path you might need to take.
@foreach (var propertyGroup in ApplicationContext.Current.Services.MemberTypeService.Get("memberType").PropertyGroups)
{
@propertyGroup.Name
foreach (var property in propertyGroup.PropertyTypes)
{
@property.Name
//Form Field
}
}
This code snippet is only a basic one to demonstrate how you could retrieve the tab information from Umbraco. In reality it would be a lot more complex I think. One thing to consider is how quickly this code would run as I believe this service would result in calls being made to the database rather than being returned from a local cache.
Displaying membership tabs for customer logedin editing
I am using Umbraco cloud and using the EditMembershipForms.cshtml partial to display the membership details for members to edit. I have created a membership type "active members" and a couple of tabs "Practice details" and "General details".
Currently the EditMembershipForms.cshtml displays the whole form. How do I display by tab, so just the fields in each tab are displayed for customer editing?
Hi Mark,
Its a little unclear how you are writing out the form based on the information you have provided. Would you be able to share more information about the code that's in the view you refer to?
I'm going to assume that there is some code in there that is looping over all of the properties that have been marked as editable on the Member Type you have defined. I would not expect this to pull in the tabs from Umbraco since they are normally only used for the UI within Umbraco its self. If you want to group the properties then I believe you would have two possible solutions.
The first is to hand code the form and group the properties manually, this would give you more control over the look of the form. The second option is to pull in the tab information from Umbraco and then use that information to write out the form. Something like the below would be along the path you might need to take.
This code snippet is only a basic one to demonstrate how you could retrieve the tab information from Umbraco. In reality it would be a lot more complex I think. One thing to consider is how quickly this code would run as I believe this service would result in calls being made to the database rather than being returned from a local cache.
Hope this helps,
Paul
Thanks Paul
I am new to Umbraco and not a coder but stubling my way round.
This is the code I am using to displays the members editable form.
@using System.Web.Mvc.Html @using ClientDependency.Core.Mvc @using Umbraco.Web @using Umbraco.Web.Controllers
@{
}
@if (Members.IsLoggedIn() && profileModel != null)
{
if (success) {
}
Any help would be much appreciated.
is working on a reply...