You have not gone blind. There is no default XSLT extension that let's you do what you want to.
If you have the neccesary skills I think it should be fairly easy to write an XSLT extension yourself. Otherwise I think you should look into installing uComponents where there is a "GetMembersByGroupName()", which could maybe what you need?
Well, I need more than just the names... I need them for searching.
Anyway, I just wrote this class to generate the XML.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
using System.Xml.XPath;
using System.Xml.Linq;
using umbraco.cms.businesslogic.member;
using System.Web.Security;
namespace MemberControls
{
public class MemberExtension
{
public static string AllMembersByGroup(){
IEnumerable<Member> members = umbraco.cms.businesslogic.member.Member.GetAllAsList();
var xdoc = new XDocument();
var xMembers = new XElement("members");
xdoc.Add(xMembers);
foreach (Member member in members)
{
var user = new XElement("member","");
foreach (umbraco.cms.businesslogic.property.Property prop in member.getProperties)
{
user.Add(new XElement(prop.PropertyType.Alias, prop.Value));
}
xMembers.Add(user);
}
return xdoc.ToString();
}
}
}
I know it uses deprecated code, but unsure how else to do it. Any pointers?
And yeah, it does get all the users, but hat's just a minor bump in the road.
New and better class, less code, not using deprecated stuff.
This is what I need. Just need to make the XSLT extension now.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
using System.Xml.XPath;
using System.Xml.Linq;
using umbraco.cms.businesslogic.member;
using System.Web.Security;
namespace MemberControls
{
public class MemberExtension
{
public static string AllMembersByGroup(){
IEnumerable<Member> members = umbraco.cms.businesslogic.member.Member.GetAllAsList();
XmlDocument xdoc = new XmlDocument();
XmlElement xMembers = xdoc.CreateElement("members");
xdoc.AppendChild(xMembers);
foreach (Member member in members)
{
XmlNode xmember = member.ToXml(xdoc, true); ;
xMembers.AppendChild(xmember);
}
return xdoc.OuterXml;
}
}
}
XSLT and Members
I'm using Umbraco 4.7
I need a memberlist displayed in frontend, preferably using XSLT
I can't seem to find anything premade that's current and working with 4.7, have I gone blind?
Thank you
Hi Rasmus
You have not gone blind. There is no default XSLT extension that let's you do what you want to.
If you have the neccesary skills I think it should be fairly easy to write an XSLT extension yourself. Otherwise I think you should look into installing uComponents where there is a "GetMembersByGroupName()", which could maybe what you need?
/Jan
Well, I need more than just the names... I need them for searching.
Anyway, I just wrote this class to generate the XML.
I know it uses deprecated code, but unsure how else to do it. Any pointers?
And yeah, it does get all the users, but hat's just a minor bump in the road.
New and better class, less code, not using deprecated stuff.
This is what I need.
Just need to make the XSLT extension now.
ACK!
The new "improved" class doesn't do the job completely. It omits custom datatypes with multiple elements, checkboxlists, dropdownlists etc.
I have to stick with the old deprecated, there I get big ole' dirty data. but it has what I need.
This is from the first code I wrote.
The second codeblock returns this.
<customdatatypecheckboxlist><![CDATA[]]></customdatatypecheckboxlist>
Oh well... enjoy if you need it.
is working on a reply...