Users Category List Tag possibility
Posted: 18 September 2008 08:34 AM   [ Ignore ]
Newbie
Avatar
Rank
Total Posts:  7
Joined  2007-03-13

I am looking for a way to display/list all users by categories that they are assigned to. It is a functionality similar to Weblog Category Archive List but would be preformed on users.

The resulting output would be something like this:

<ul>
<
li>Slovakia
  
<ul>
   <
li>User A</li>
   <
li>User B</li>
   <
li>User C</li>
  </
ul>
</
li>
<
li>Poland
  
<ul>
   <
li>User D</li>
   <
li>User E</li>
   <
li>User F</li>
  </
ul>
</
li>
<
li>Czech Republic
  
<ul>
   <
li>User G</li>
   <
li>User H</li>
   <
li>User I</li>
  </
ul>
</
li>
</
ul>

in case the users were assigned to those three categories: Slovakia, Poland, Czech Republic

Thanks in advance

 Signature 

http://www.elementalmedia.info

Profile
 
 
Posted: 18 September 2008 10:09 AM   [ Ignore ]   [ # 1 ]
Newbie
Avatar
Rank
Total Posts:  7
Joined  2007-03-13

OK I came up with a solution wrapping the {exp:user:users} in the standard EE {exp:weblog:categories} tag like this:

{exp:weblog:categories category_group="2" show="not 16|5" style="nested" show_empty="yes" weblog="weblog_name"}{category_name}
<ul>
  
{exp:user:users category="{category_id}" dynamic="off"}
   
<li>{screen_name}</li>
  
{/exp:user:users}
</ul>
{/exp:weblog:categories}

This gives me exactly the list that I mentioned in my previous post. Even better, when I use the {path=} inside the <li> like:

<li><a href="{path=people}">{screen_name}</a></li>

I am getting an output

<li><a href="http://www.example.com/people/category/slovakia">{screen_name}</a></li>

Too bad that the Listing users by category from URL with the {exp:user:users} (Member list) tag does not work. It could be used automatically.

Not sure if this too much stress for the SQL requests but renders pretty quickly in my case.

 Signature 

http://www.elementalmedia.info

Profile
 
 
Posted: 18 September 2008 10:14 AM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Nice work wink

 Signature 
Profile