Copied to clipboard

Flag this post as spam?

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


  • Tri Mandir Prajapati 42 posts 60 karma points
    Nov 06, 2015 @ 07:21
    Tri Mandir Prajapati
    0

    Add Member Creation Date in Member List View

    Hello Robert,

    How can I add member create date next to email in member list view. Would you mind helping me on that.

    Thanks

    Regards Tri.

  • Robert Foster 459 posts 1820 karma points MVP 2x admin c-trib
    Nov 06, 2015 @ 07:39
    Robert Foster
    0

    Hi Tri, Grab the source code from the GitHub repository... you could easily add the create date by editing the html template. You may need to alter the controller as well, but I don't think so.

    I'll try to post a more comprehensive reply a little later when I have time to devote to it.

    Rob.

  • Tri Mandir Prajapati 42 posts 60 karma points
    Nov 06, 2015 @ 08:23
    Tri Mandir Prajapati
    0

    Hello Rob,

    Thanks for the reply, I did add the code.. {{result.createDate}} in html and

    .ForMember(member => member.CreateDate, expression => expression.MapFrom(result => result.Fields["createDate"])) in MemberItemMapper

    and

    [DataMember(Name = "CreateDate")] public string CreateDate { get; set; } in MemberListItem.cs

    and rebuild the solution.. but was not working.. Something to do with the keyword.. createdate. It is showing error of not founding the key.

    So, I did post this query.

    Thanks

    Regards

    Tri

  • Robert Foster 459 posts 1820 karma points MVP 2x admin c-trib
    Nov 06, 2015 @ 08:28
    Robert Foster
    0

    ok, so it's a little more complicated:

    1. Make sure you're including the createDate field (I have to check this) in your /config/ExamineIndex.config file.
    2. Rebuild your index.
    3. You should then be able to access the new field in the properties dictionary object on the member.

    Of course, this is all theoretical until I can get to the project and try it out myself.

    MemberListView is heavily dependent on the Examine index. If you don't have the createDate field (or whatever it should be - I'll have to look in the Umbraco source) in the index then you won't be able to retrieve it for display.

    Hope this helps, Rob.

  • Tri Mandir Prajapati 42 posts 60 karma points
    Nov 06, 2015 @ 08:45
    Tri Mandir Prajapati
    0

    Hi Rob

    I add the createDate, now it looks like

    <IndexAttributeFields/>

      <add Name="id" />
      <add Name="nodeName"/>
      <add Name="updateDate" />
      <add Name="writerName" />
      <add Name="loginName" />
      <add Name="email" />
      <add Name="nodeTypeAlias" />
      <add Name="createDate"/>
    </IndexAttributeFields&gt;"
    

    Now the dictionary key error has gone, but I couldn't make it to sort the list by create date, i change this field by create date in memberlistview.controller.js as well as in membersearch..

    and also the createdate is not showing in the list view...

    Regards

    Tri.

  • Robert Foster 459 posts 1820 karma points MVP 2x admin c-trib
    Nov 06, 2015 @ 08:50
    Robert Foster
    0

    You'll need to do a fair bit more work to make sorting work with createDate including custom indexing the date so that it can be formatted. There are a few forum posts/blogs about this kind of thing.

    Make sure that the createDate field is getting into your properties dictionary (you can inspect the network traffic as the list is being populated to see what the member data is looking like and use that knowledge to modify the memberlistview.html template.

    • Rob.
  • Tri Mandir Prajapati 42 posts 60 karma points
    Nov 06, 2015 @ 08:53
    Tri Mandir Prajapati
    0

    Hi Rob,

    Thanks I will try that one.

    Regards

    Tri

  • Tri Mandir Prajapati 42 posts 60 karma points
    Nov 06, 2015 @ 09:17
    Tri Mandir Prajapati
    0

    Hi Rob,

    One quick issue i found in the package is that, sorting in list using Email doesn't work too.

    Received an error from the server Failed to retrieve members

    The given key was not present in the dictionary.

    EXCEPTION DETAILS:

    System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. STACKTRACE:

    at System.Collections.Generic.Dictionary2.get_Item(TKey key) at MemberListView.Helpers.MemberSearch.<>c__DisplayClass7.<PerformMemberSearch>b__4(SearchResult o) at System.Linq.EnumerableSorter2.ComputeKeys(TElement[] elements, Int32 count) at System.Linq.EnumerableSorter1.Sort(TElement[] elements, Int32 count) at System.Linq.OrderedEnumerable1.

Please Sign in or register to post replies

Write your reply to:

Draft