• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: CGUserDirectory filter search result based on group
PostPosted: Thu Nov 11, 2010 3:35 pm 
Offline
Power Poster
Power Poster

Joined: Sat Nov 25, 2006 3:39 pm
Posts: 342
Location: Copenhagen, Denmark
If you use {CGUserDirectory group="members"} in a page you can filter what users to see in the list. But if you do a search on user properties the result also shows users not belonging to that group.

My way around it is this little trick in the summary template:

Code:
{foreach from=$users item='oneuser'}

{foreach from=$oneuser.groups item='onegroup'}
      {assign var="groupname" value=$groups.$onegroup.groupname}
{/foreach}

{if $groupname == "members"}
Show content.
{/if}

{/foreach}


NB! This won't work if a user belong to several groups

Hope someone finds it useful.


Last edited by webform on Thu Nov 11, 2010 3:43 pm, edited 1 time in total.

Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: CGUserDirectory filter search result based on group
PostPosted: Thu Dec 30, 2010 11:06 am 
Offline
Forum Members
Forum Members

Joined: Wed Jul 14, 2010 9:41 am
Posts: 22
Thanks a bunch! This saved me from alot of work!


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting