45 Posts
mato
10 years ago
5
Topic

Hi everyone,

I try to present my users only the items they can view/edit.

I hoped to get the current user group as a variable, so that I could use it fo fill a hidden select field using conditional states (If usergroup is 38 -> value = 6, for example).

I would have to add a conditional state for each new group, but that would work.

My problem is I can't get the value of the Group ID : does someone know how to retrieve it, using the Seblod way ?

I also would like a Seblod field to display the current user group name...

Thank you,

-Mato

Get a Book for SEBLOD
45 Posts
mato
10 years ago
1
Level 1

Reading the forum, filtering by user is easy : create a "Created by" field, use "user" as live value and configure it to "id".

Still wondering how to filter by User Group, though...

-Mato

4229 Posts
Kadministrator
10 years ago
0
Level 2

Similar to user - there is JForm-usergorupd field you can use and set its live value to User->usergroups. Take a note that this usually gives you mutiple values like 1,2,3 as user is usally a member of mutiple groups.

45 Posts
mato
10 years ago
0
Level 1

Thank you for answer !

I tried to :
- add a "JForm - User Groups" field
- set the Live column to "User" (in [2])
- click configure
- set Property to "usergroups", as described

Using "Value" for [1], the field remains empty, and using it as a filter I don't get any results...
What surprises me is that `usergroups` is not a field in the user table : are you sure it is the right spelling for this property ?

Is there a way to know all the different "properties" available ?

Regards,

-Mato

P.S. : also the session cookie on the forum is <i>very</i> short...

4229 Posts
Kadministrator
10 years ago
1
Level 1
45 Posts
mato
10 years ago
0
Level 2

Thanks for the link, I didn't know that field allows direct access to Joomla's current user object.

Get a Book for SEBLOD