Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mark Watson 118 posts 384 karma points
    Jun 05, 2018 @ 01:30
    Mark Watson
    0

    Member edit own details on secure page

    I am new to Umbraco and can someone give me a guide to the approach I need to use to achieve the following.

    I have a page on the web site which lists the contact details of members.

    I have created an Member Type "Active Members" with additional text boxes, Address, Phone etc.

    I wish to display the Active members details on a secure page which they need to sign in to and change their password, password question and details that are published.

    Is this the right approach?

  • Andy Felton 185 posts 484 karma points c-trib
    Jun 05, 2018 @ 07:21
    Andy Felton
    0

    Hi Mark,

    Your approach looks correct. to load and save you member data I'd suggest using the MemberService https://our.umbraco.org/documentation/reference/management/services/memberservice.

    Thanks Andy

  • Mark Watson 118 posts 384 karma points
    Jun 15, 2018 @ 06:12
    Mark Watson
    0

    Thanks Andy

    I am new to Umbraco so I do not understand what to do with this information. I have added a tab to my active members typeenter image description here

    I wish to achieve 2 things:

    1. Publish the infomation on this tab on the web site. This will list the Drs practice details Name, Address and phone etc.

    2. Give access to the Drs to a secure page where they can edit their details.

    How do i achieve these 2 things?

  • Andy Felton 185 posts 484 karma points c-trib
    Jun 15, 2018 @ 09:12
    Andy Felton
    0

    Hi Mark,

    To edit details on a member then this blog may be helpful has it provided details of how to use the MemberServer -https://24days.in/umbraco-cms/2014/dealing-with-members/.

    Documentation for the membership service can be found here https://our.umbraco.org/documentation/reference/management/services/memberservice.

    The issue with all these functions are they directly access the database, but I do not believe there is any XML cache of the members so therefore this is probably the only method. If your website has a lot of members or page views you may want to look at how to cache this page.

    Hope that helps Andy

  • Mark Watson 118 posts 384 karma points
    Jun 18, 2018 @ 02:17
    Mark Watson
    0

    Thanks Andy 4 weeks into learning Umbraco and a non programmer I do not understand these concepts yet. To learn it would be easier to break it down to each requirement.

    How would I display the practice name above on a template?

     @foreach (var member in memberservice.GetMembersByType("activeMembers"))
    {
                <p>@member.practice1Name</p>
    }
    

    Does not work. There seems to be little documentation/ examples for beginners.

  • Andy Felton 185 posts 484 karma points c-trib
    Jun 18, 2018 @ 07:22
    Andy Felton
    0

    Hi Mark,

    Are you getting an error or is nothing being displayed?

    Thanks Andy

  • Mark Watson 118 posts 384 karma points
    Jun 19, 2018 @ 00:44
    Mark Watson
    0

    I can display the member name in the "activeMembers" by using member.name

    @foreach (var member in ApplicationContext.Current.Services.MemberService.GetMembersByMemberType("activeMembers"))
        {
           <p> @member.Name</p>
    
               <p> @member.GetPropertyValue("practice1Address")</p>
        }
    

    But when I try and display a field in the Practice details tab in the Active Members Member type I get the yellow screen. i am working in Umbraco cloud.

    Am I not sure that i am following the right path to achieve what i want to do?

  • Mark Watson 118 posts 384 karma points
    Jun 20, 2018 @ 05:06
    Mark Watson
    0

    I got this working.

    @foreach (var member in ApplicationContext.Current.Services.MemberService.GetMembersByMemberType("activeMembers"))
        {
          var prac1name = member.GetValue("practice1Name");
    
    <p> @prac1name</p>
    

    }

  • Andy Felton 185 posts 484 karma points c-trib
    Jun 20, 2018 @ 05:22
    Andy Felton
    0

    Hi Mark,

    Sorry didn't get a chance to reply yesterday.

    Yes that is correct with the MemberService you use GetValue to read values of the property.

    Let me know if you need any more help.

    Thanks Andy

  • Mark Watson 118 posts 384 karma points
    Jun 20, 2018 @ 07:12
    Mark Watson
    0

    Thanks Andy All woked fine until I created a drop down menu for the various states. When I use

     var prac1st = member.GetValue("practice1State");
    

    @prac1st

    I get the number and not the text (ie 93 instead of NSW)

    How do I get the text?

Please Sign in or register to post replies

Write your reply to:

Draft