Copied to clipboard

Flag this post as spam?

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


  • ashwini 43 posts 63 karma points
    May 23, 2012 @ 21:01
    ashwini
    0

    How to display members from a group ?

    I have used CMS import to import all the members into a membergroup. I want to display all the members from that group on a webpage. I tried to research about the issue but there is not much documentation and i am pretty new to umbraco. Any one please point me in the right direction ??

    Thanks in advance !

    Ashwini.

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Jun 03, 2012 @ 13:39
    Lee Kelleher
    0

    Hi Ashwini,

    I replied to your other posts (about GetMembersByGroupName) last week - not sure if you have a solution yet?

    Rather than using XSLT, you could use a .NET user-control to list the group members instead?

    <%@ Control Language="C#" %>
    <% @Import Namespace="System.Text" %>
    <% @Import Namespace="umbraco.cms.businesslogic.member" %>
    
    <script runat="server">
        public static StringBuilder OutputHtml = new StringBuilder();
    
        protected void Page_Load(object sender, EventArgs e)
        {
            var group = MemberGroup.GetByName("Active");
            if (group != null)
            {
                var members = group.GetMembers();
                if (members != null && members.Length > 0)
                {
                    foreach (var member in members)
                    {
                        var firstname = member.getProperty("firstName").Value.ToString();
                        var surname = member.getProperty("surname").Value.ToString();
    
                        OutputHtml.AppendFormat("{0} {1}<br/><a href='/view-profile.aspx?id={2}'>View Profile</a>", firstname, surname, member.Id);
                    }
                }
            }
        }
    </script>
    
    <%= OutputHtml %>

    You could probably do this in a Razor macro too? ;-)

    Hope this helps.

    Cheers, Lee.

  • ashwini 43 posts 63 karma points
    Jun 04, 2012 @ 21:46
    ashwini
    0

    thanks a lot for the code Lee :). I wrote something similar in razor and it working great :). Thanks a lot for all your help in the past few weeks. You are a life saver :)

     

  • ashwini 43 posts 63 karma points
    Jun 05, 2012 @ 17:09
    ashwini
    0

    i had one more issue in umbraco, nforum to be specific...could you please take a look at it when you have some time ? I would really appreciate it...

    http://our.umbraco.org/projects/website-utilities/nforum/general/32135-Getting-error-with-loginlogout-

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Jun 05, 2012 @ 22:45
    Lee Kelleher
    0

    Hi Ashwini,

    I had a read over your other post, but I don't know much about nForum - it was developed by the *other* Lee.

    Hopefully he'll pick up email notifications from the nForum topics and get back to you.

    Cheers, Lee.

  • ashwini 43 posts 63 karma points
    Jun 06, 2012 @ 00:02
    ashwini
    0

    Actually its not the issue about nforum entirely, there is something wrong with content node id because if you look at the images of the error i posted, you can see that my content has no node id. If i click on content folder, i get the error saying "No node exists with id '1391'. I have a feeling that if i can fix this, the nforum would work as well...

    when i look into db tables my masterpage has node id of 1639. there is no reference of 1391 anywhere in the db tables...so i am clueless....

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Jun 06, 2012 @ 00:36
    Lee Kelleher
    0

    It looks like nForum is using a data-type that references a member (node) ... and the member it is trying to access has the Id of "1391"?

    I'm not sure what what happened to that member (1391), but it looks like it's been deleted somehow?

    If you can find out how nForum references that member id, then figure out how to remove that reference - that might resolve it?

     

    All of this is complete guess work from me... as I've never used nForum (yet).

    Good luck!

    Cheers, Lee.

Please Sign in or register to post replies

Write your reply to:

Draft