User element display full name of author

wouter.galia

New Member
Hi

I am using the user element to show the name (author) of an item. The author is visible in lists etc.

This worked perfectly until I had to add the family name. Is there a way to show the name and family name stored in my Fabrik users table based on the user element ID? And example would be great, I'm not an expert at this.

For the ccd element I am already using the concat label.
 
Well, a 'user' element can only ever show attributes which are part of the main J! #__users table (name, username, email, etc).

Are you trying to show an additional name, which is not in the J! user table?

If so, you'll have to use a join element rather than a user element. Default it to ...

{$my->id}

... so it defaults to the logged in user. Join to the J! #__users table. Use 'id' for the value. Then for the CONCAT, do something like ...

{thistable}.name, ' - ', (SELECT family_name FROM your_other_table WHERE userid = {thistable}.id)

Leave {thistable} as is, adjust the other names to suit.

Note that it should be safe to change your existing user element to be a join to #__users, you won't lose data.

-- hugh
 
Thank you, this info was really helpful! I changed all the user fields like you said.

My fabrik users table syncs with the J users data. So all I had to do is default the join element to {$my->id} connect to the users table and use {thistable}.name,' ',{thistable}.familyname as concat label.

Hope this helps someone else in the future.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top