Dynamic List Based on UserGroup

Fishwagon

New Member
Hello all,

Sorry for the n00b question, but here it is.

I'd like to create a list that dynamically populates based on a usergroup.

Basically we have a group who's members come and go on a regular schedule. We want to display that list of people to all members so they know who to contact when an issue arises. So we want the list to react to changes of the members of a group, so when the admin moves those people in/out of the group, the list dynamically updates.

I guess what I'm saying is that I want a way to dynamically add/remove records of a list based on a database query.

Is that possible? I can see how to make dynamic drop down elements, but not dynamic list entries.

Thank you...
Rich
 
The only way of doing that would be to create a list on the actual J! users table (make sure you set "Alter existing fields" to No in the list advanced settings), and then create a pre-filter on it so it only shows the group you want. That filter has to be a subquery, because of the way J! uses a many-to-many map for the users / groups relationship. So your pre-filter query be something like ...

Field: id
Condition: IN
Value: SELECT user_id FROM #__user_usergroup_map WHERE group_id = 123
Type: Query

Replace 123 with the ID of your target group.

-- hugh
 
Worked perfectly thank you Hugh.

My mistake was that I already created the table and was trying to modify. once I created a new table, I saw how you can link it to an existing table/view for it's datasource, versus having it build it's own table to store the data.

n00b mistake...

But thank you....
Rich
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top