We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45766
    • 78 Posts
    Hi,

    is it possible to use classExtender Fields for Sorting at the peoples snippet from the peoples Extra?

    I can choose an &sortByAlias (User, Profile,…). Shouldn't it be possible to use something like extUser here?

    extUser doesn't work - i tried that bevor writing wink
      • 4172
      • 5,888 Posts
      peoples doesn't join to the extended table, but you could use migxLoopCollection for the listings, too
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 45766
        • 78 Posts
        Hi Bruno,

        it seems to be a little bit to tekkie for me.
        I did not understood how i can get for example All Users

        1. from Usergroup = A
        2. status = active
        3. colorEyes = blue (classExtenderField)
        4. sortedBy = colorHair (classExtenderField)
        5. limit = 10 (to use with getPage)
        6. tpl = chunkName => including all Profil Infos as Placeholder

        [[migxLoopCollection? 
            &classname=`i need: extUser, modUser, modUserProfile`
            &selectfields=`Here the fields i need? fullname, photo, colorHair, colorEyes, firstName, lastName, …`
            &where=`should be very long in my case`
            
        ]]
        
          • 4172
          • 5,888 Posts
          something like that:

          [[migxLoopCollection? 
              &classname=`extUser`
              &joins=`[{"alias":"User"},{"alias":"Profile"},{"alias":"UserGroupMember","classname":"modUserGroupMember","on":"UserGroupMember.member=User.id"}]`
              &where=`{"UsergroupMember.user_group":"99","User.active":"1","colorEyes":"blue"}`
              &sortConfig=`[{"sortby":"colorHair"}]`
              &limit=`10`
              &tpl=`yourTpl` 
          ]]
          

          in the tpl you have all fields of extUser + of all joined tables

          for example [[+Profile_fullname]] or [[+User_username]]

          you can view all fields, if you remove the tpl - property
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 45766
            • 78 Posts
            Wow! Sounds fantastic!!!
            Can't wait to try it tomorrow:)
              • 45766
              • 78 Posts
              WOW!!! Till now absolutely perfect! Will test a few things, but right now it look exactly what i need!!!

              ! For all who would like to use classExtender and MIGxLoopCollection. You should use "userData" instead of extUser.

              But the filter for the userGroup doesn't work. The user is inside the Group with the id 2 but the List stays empty.

              [[!migxLoopCollection? 
              			    &classname=`userData`
              			    &joins=`[{"alias":"User"},{"alias":"Profile"},{"alias":"UserGroupMember","classname":"modUserGroupMember","on":"UserGroupMember.member=User.id"}]`
              			    &where=`{"UsergroupMember.user_group":"2","User.active":"1","showMvz":"show"}`
              			    &sortConfig=`[{"sortby":"company"}]`
              			    &limit=`10`
              			    &tpl=`sectionListing-user` 
              			]]
              


              Wo war nochmal Deine Spedenseite?
                • 45766
                • 78 Posts
                Maybe it doesn't work because the user is in more than one group?
                  • 45766
                  • 78 Posts
                  i found another problem. If i use get Page. If i choose limit=1 the pager shows 3 pages but there a just 2 objects (checked it with the normal call without template). The second Page is empty

                  [[!migxLoopCollection?
                  			 	
                  			 	&classname=`userData`
                  			 	&joins=`[{"alias":"User"},{"alias":"Profile"},{"alias":"UserGroupMember","classname":"modUserGroupMember","on":"UserGroupMember.member=User.id"}]`
                  			 	&where=`{"User.active":"1","showMvz":"show"}`
                  			 	&sortConfig=`[{"sortby":"company"}]`
                  			 	&limit=`3`
                  			 	&tpl=``
                  			]]
                  
                  <!-- Result => 2 -->
                  
                  
                  			
                  			[[!getPage?
                  				&elementClass=`modSnippet`
                  				&element=`migxLoopCollection`
                  			 	
                  			 	&classname=`userData`
                  			 	&joins=`[{"alias":"User"},{"alias":"Profile"},{"alias":"UserGroupMember","classname":"modUserGroupMember","on":"UserGroupMember.member=User.id"}]`
                  			 	&where=`{"User.active":"1","showMvz":"show"}`
                  			 	&sortConfig=`[{"sortby":"company"}]`
                  			 	&limit=`1`
                  			 	&tpl=`sectionListing-member`
                  			]]
                  <!-- Result => 3 Pages, second stays empty -->
                  



                  Tried it with 3 results and a limit of 2

                  First Page hast 1 and second Page 2 entries. But at the second Page is still the one entry from the first page and the third entry did not appear [ed. note: stefan79w last edited this post 6 years, 9 months ago.]