Copied to clipboard

Flag this post as spam?

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


  • Darren Wilson 238 posts 646 karma points
    Sep 13, 2016 @ 16:32
    Darren Wilson
    0

    Another membership type question!

    Hi Folks,

    I'm trying to hide something that has a NULL result within a members area:

    @if (Members.IsLoggedIn() && profileModel != null)
    {   
    using (Html.BeginUmbracoForm<UmbProfileController>("HandleUpdateProfile", null, new { id = "updateProfileForm" }))
    {
        var member = Members.GetByUsername(profileModel.UserName);
        var pharmacyName = member.GetPropertyValue("pharmacyName");
        var contractorCode = member.GetPropertyValue("contractorCode");
        var healthBoardArea = member.GetPropertyValue("healthBoardArea");
        var cPHealthBoardCommittee = member.GetPropertyValue("cPHealthBoardCommittee");
    
    
        @Html.Label("Name: ", new { @class = "profile-label"})
        @Html.DisplayFor(m => profileModel.Name, new { @class = "profile-details"})
        @Html.Raw("<br>")
    
        @Html.Label("Email: ", new { @class = "profile-label"})
        @Html.DisplayFor(m => profileModel.Email, new { @class = "profile-details"})
            @Html.Raw("<br>")
    
        @Html.Label("Pharmacy Name: ", new { @class = "profile-label"})
        @Html.DisplayFor(m => pharmacyName, new { @class = "profile-details"})
            @Html.Raw("<br>")
    
        @Html.Label("Contactor Code: ", new { @class = "profile-label"})
        @Html.DisplayFor(m => contractorCode, new { @class = "profile-details"})
            @Html.Raw("<br>")
    
        @Html.Label("Health Board Area: ", new { @class = "profile-label"})
        @Html.DisplayFor(m => healthBoardArea, new { @class = "profile-details"})
            @Html.Raw("<br>")
    
        @Html.Label("CP Health Board Committee: ", new { @class = "profile-label"})
        @Html.DisplayFor(m => cPHealthBoardCommittee, new { @class = "profile-details"})
            @Html.Raw("<br>")
    
    
    
    }  
    
    
    }
    

    If there is no output detected for CP Health Board Committee, id like this whole block hidden. Could someone point me in the right direction. Apologies for the vagueness of this post ;-)

    Thanks Darren

  • Darren Wilson 238 posts 646 karma points
    Sep 15, 2016 @ 12:25
    Darren Wilson
    0

    Is it possible to add a member group to this statement - I've googled it but I don't think it's possible?

    @if (Members.IsLoggedIn() && profileModel != null)

    So if members of group A logs in it runs this statment.

    Sorry my knowledge is a bit limited here.

    Thanks for helping oot!

    Darren

  • Darren Wilson 238 posts 646 karma points
    Sep 15, 2016 @ 12:33
    Darren Wilson
    0

    In fact this is what I'm trying to achieve:

    if member group = groupa then display these custom member types

    if member group = groupb then display these custom member types

Please Sign in or register to post replies

Write your reply to:

Draft