dynamic_parameters category
Posted: 02 April 2008 10:04 PM   [ Ignore ]
Member
RankRankRank
Total Posts:  76
Joined  2007-07-19

I want to create dynmically sortable user list.  Is it possible to use catergory as a filter?  I so I would want to create a list that shows usernames, in ascending order, that are only user category 4.

Am I correct in thinking you currently can only use sort and orderby?

I’d rather not use search to achieve this.

Profile
 
 
Posted: 02 April 2008 10:12 PM   [ Ignore ]   [ # 1 ]
Member
RankRankRank
Total Posts:  76
Joined  2007-07-19

On a related note, I can’t even figure out how to get the user sort to work as it seems to be a bit different from how EE does it?  Has anyone got any example code?

Profile
 
 
Posted: 03 April 2008 07:46 AM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3350
Joined  2006-10-18

Joobs,

It works very similar to the EE sorting… have a look at this example: smile

<form method="post" action="{path="user/users"}">
<
select name="user_orderby">
<
option value="username">Username</option>
<
option value="screen_name">Screen Name</option>
<
option value="join_date">Join Date</option>
</
select>

<
select name="user_sort">
<
option value="asc">Ascending</option>
<
option value="desc">Descending</option>
</
select>

<
input type="submit" value="Sort" />

</
form>

{exp:user:users orderby="total_entries" sort="desc" dynamic_parameters="yes"}

<p>Screen Name: {screen_name}</p>
<
p>Total Entries: {total_entries}</p>
<
p>Join Date: {join_date  format="%m %d, %Y"}</p>
<
p>Email: {email}</p>
<
br /><br />

{/exp:user:users}

 Signature 
Profile
 
 
Posted: 03 April 2008 07:21 PM   [ Ignore ]   [ # 3 ]
Member
RankRankRank
Total Posts:  76
Joined  2007-07-19

Thanks for the code example.

Going back to my first post, is there any way to do a sort by category too (as well as doing the username sort)?

I want to create a list of our users with the sorting options you quotes above, but have a third sorting (filter) option - only show users belonging to a specific catergory.

Is that possible?

Profile
 
 
Posted: 03 April 2008 08:57 PM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3350
Joined  2006-10-18

I know you’re pretty limited currently with the Categories variable pair.... but I suppose if it’s possible, you might need to work it in the URL itself, and grab the segment of the URL into a parameter for the User:Users loop… if that makes any sense. I’m not sure if any of this would work… haven’t given it a whirl yet LOL

 Signature 
Profile
 
 
Posted: 03 April 2008 09:04 PM   [ Ignore ]   [ # 5 ]
Member
RankRankRank
Total Posts:  76
Joined  2007-07-19

I think I understand what you are suggesting, but I’m quite inexpereinced when it comes to forms and such.  How would i get the category into a URL segment from only clicking submit on the form that sets the orderby and sort paramenters?

Profile
 
 
Posted: 04 April 2008 07:30 AM   [ Ignore ]   [ # 6 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3350
Joined  2006-10-18

Yeah, it might not be the easiest to accomplish an integrated form solution that will filter and sort in this instance…
You could otherwise use a Javascript driven form for a Category parameter to set the URL (to add the category segment into the URL) so it looks like this:
http://www.yoursite.com/user/users/C5

Then dynamically sort with the other two dropdowns as a seperate form wink
You’ll need to set your orderby and sort form return URL to have a {segment_3} built into it to retain the Category number in the URL.

I’ve tried testing this out a bit on my test site, and the Users loop seems to react to the dynamic category URL. smile

 Signature 
Profile
 
 
Posted: 04 April 2008 05:37 PM   [ Ignore ]   [ # 7 ]
Member
RankRankRank
Total Posts:  76
Joined  2007-07-19

Ok, I think i’ll have a go with the javascript solution,

But I would like to make a feature request to have a category filter built into the dynamic paramaters.

<select name="user_category">
<
option value="1">Cat 1</option>
<
option value="2">Cat 2</option>
<
option value="3">Cat 3</option>
</
select>

Profile
 
 
Posted: 04 April 2008 06:04 PM   [ Ignore ]   [ # 8 ]
Member
RankRankRank
Total Posts:  76
Joined  2007-07-19

Another feature resquest

it seems to save your sort even if you leave the page and go back.  Would it be possible to have an option so it only saves the sort information when it’s paginated, so if you visit the form again it goes back to the default sort options.

And while i am it, may I request {current_page} and {total_pages} be added the the user pagination tag, they don’t seem to be included currently smile

Profile
 
 
Posted: 04 April 2008 10:09 PM   [ Ignore ]   [ # 9 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3350
Joined  2006-10-18
Joobs - 04 April 2008 06:04 PM

Would it be possible to have an option so it only saves the sort information when it’s paginated, so if you visit the form again it goes back to the default sort options.

This apparently exists…
http://www.solspace.com/docs/entry/user_users/#user_orderby

User:Users Documentation -

Also note that the order and sort values are saved to cookies so that the preference is remembered during pagination.

I will note the others wink

 Signature 
Profile
 
 
Posted: 05 April 2008 06:09 PM   [ Ignore ]   [ # 10 ]
Member
RankRankRank
Total Posts:  76
Joined  2007-07-19
Pie Man - 04 April 2008 10:09 PM

This apparently exists…
http://www.solspace.com/docs/entry/user_users/#user_orderby

It saves the sort information over the paginated pages.  But if I leave that site or section and come back to it later it often still has saved the sort information.  I’d rather it went back to the default sort, but this might be down to taste.

But I think i’m going to try to do what i want with javascript and URL segments.

Profile