Copied to clipboard

Flag this post as spam?

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


  • Claushingebjerg 939 posts 2574 karma points
    Aug 07, 2009 @ 15:51
    Claushingebjerg
    0

    Listing members frontend...

    Is it possible to list members from a certain member group using standard xslt? Or does it take some custom usercontrol to do it?

    Im thinking in the lines of showing the board of directors of a company frontend, using the members section as a source...

  • Chris Koiak 700 posts 2626 karma points
    Aug 07, 2009 @ 16:19
    Chris Koiak
    0

    As far as I'm aware there is no xml/xslt based member listing facility.

    I've always thought this would make a great package.

    The XML for each member is stored in the DB. Someone would just need to write an event handler (are there events for members creation?) that saved the xml out to a file.

    Chris

  • Chris Koiak 700 posts 2626 karma points
    Aug 07, 2009 @ 17:23
    Chris Koiak
    0

    Also http://forum.umbraco.org/yaf_postst8410_Member-Search.aspx provides a nice idea via Lucene... worth considering.

  • Tommy Poulsen 514 posts 708 karma points
    Aug 07, 2009 @ 17:46
    Tommy Poulsen
    2

    Casey Neehouse made an xslt extension for this - see http://forum.umbraco.org/yaf_postst9591_Getting-Members-Groups-From-Member-ID-in-XSLT.aspx

    >Tommy

     

  • Chris Koiak 700 posts 2626 karma points
    Aug 07, 2009 @ 17:56
    Chris Koiak
    0

    If you're going to use this (and it looks a good extension) I'd add some caching.

    You can hook into the Member.New, Member.AfterSave and Member.AfterDelete events and alter the cached values.

     public class EventHandler : ApplicationBase
    {
    public EventHandler()
    {
    Member.New += new Member.NewEventHandler(Member_New);
    Member.AfterSave += new Member.SaveEventHandler(Member_AfterSave);
    Member.AfterDelete += new Member.DeleteEventHandler(Member_AfterDelete);
    }

    void Member_AfterDelete(Member sender, umbraco.cms.businesslogic.DeleteEventArgs e)
    {
    //TODO: Remove row from XML.
    }

    void Member_AfterSave(Member sender, umbraco.cms.businesslogic.SaveEventArgs e)
    {
    //TODO: Update row in XML
     }

    void Member_New(Member sender, umbraco.cms.businesslogic.NewEventArgs e)
    {
    //TODO: Add row to XML
    }
    }
  • Claushingebjerg 939 posts 2574 karma points
    Aug 24, 2009 @ 15:50
    Claushingebjerg
    0

    Sorry for being a total noob on this but ive got the extension compiled and included (i think...)

    This is my xslt. The extension is called "UserExtensions". But the following doesnt return any members. Any idea why?

     

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
        version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:msxml="urn:schemas-microsoft-com:xslt"
        xmlns:UserExtensions="urn:UserExtensions"
        xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:ForumExtensions="urn:ForumExtensions"
        exclude-result-prefixes="msxml umbraco.library UserExtensions Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ForumExtensions ">

    <xsl:output method="xml" omit-xml-declaration="yes"/>
    <xsl:param name="currentPage"/>
    <xsl:template match="/">
    <xsl:for-each select="UserExtensions:GetMembersAll">
            <xsl:value-of select="@id"/><xsl:value-of select="."/><br/>
        </xsl:for-each>
    </xsl:template>

    </xsl:stylesheet>

  • Chris Koiak 700 posts 2626 karma points
    Aug 24, 2009 @ 16:45
    Chris Koiak
    0

    try

    <xsl:for-each select="UserExtensions:GetMembersAll()">

    you can also check what's returned by using

    <textarea cols="20" rows="20">
    <xsl:copy-of select="UserExtensions:GetMembersAll()">
    </textarea>
  • Claushingebjerg 939 posts 2574 karma points
    Aug 26, 2009 @ 15:49
    Claushingebjerg
    0

    im slowly getting there. When doing the copy-of, i get the following output:

    <root count="2">
    <node id="1101" version="40a5498f-f017-45a0-8298-cebaa4bf06cf" parentID="-1" level="1" writerID="0" nodeType="1100" template="0" sortOrder="2" createDate="2009-08-21T15:53:35" updateDate="2009-08-21T15:53:35" nodeName="A" urlName="a" writerName="Administrator" nodeTypeAlias="Medlem" path="-1,1101" loginName="a" email="[email protected]"><data alias="memberpic" />
    </node>

    But no matter what i try using xslt for getting a vule it returns nothing. Im pretty sure i have some scoping mixed up, so any pointers in the right direction would be great. Im trying stuff like:

    <xsl:for-each select="UserExtensions:GetMembersByGroupName('Medlemmer')">
        <xsl:value-of select="@nodeName"/>
    </xsl:for-each>

    Thanks

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Aug 26, 2009 @ 16:01
    Dirk De Grave
    100

    Hi,

    me thinks it should be:

    <xsl:for-each select="UserExtensions:GetMembersByGroupName('Medlemmer')/node">
        <xsl:value-of select="@nodeName"/>
    </xsl:for-each>

    Cheers,

    /Dirk

  • Claushingebjerg 939 posts 2574 karma points
    Aug 26, 2009 @ 16:11
    Claushingebjerg
    0

    Succes! Thanks a lot guys

  • Jakob Hansen 1 post 21 karma points
    Sep 18, 2009 @ 15:19
    Jakob Hansen
    0

    Sorry to open this again but.. i can't get it to compile (i guess it's Neehouse's script at  http://forum.umbraco.org/yaf_postst9591_Getting-Members-Groups-From-Member-ID-in-XSLT.aspx , Claus is using right?)  im a noob at this stuff,

    But i get the error:
    The type or namespace name 'ApplicationBlocks' does not exist in the namespace 'System' (are you missing an assembly reference?)

    What it says at the line is:

    using

     

    System.ApplicationBlocks.Data;  (i change it from Microsoft. to System. , same error)

    .. remember I am an noob at this hehe

  • Ulla Skaanning 67 posts 97 karma points
    Aug 24, 2010 @ 20:00
    Ulla Skaanning
    0

    Hi

    I am getting the same error as above when i try to build the extension - did anybody solve this??

    / Ulla

Please Sign in or register to post replies

Write your reply to:

Draft