Forum

Thread tagged as: Question

Display current users name in admin

Is there any way to show the current logged in user under Region Options > Item list column IDs on a list and detail setup? Only a requirement in the backend not to display on the page.

Andy Knight

Andy Knight 1 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

There isn't. What are you trying to achieve here?

The site has a news list and detail setup. The client has 3 contributors and wants to see who added which article.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, so you don't want to show the current user, but the author of the item, is that right?

Duncan Revell

Duncan Revell 78 points
Registered Developer

Andy,

I don't know if this will be helpful or not - I wanted something similar a while back and wrote a custom fieldtype. I can't remember if/where I have a copy of the code, but I remember it being actually quite straightforward...!

Drew McLellan said:

Ok, so you don't want to show the current user, but the author of the item, is that right?

Hi Drew,

Are they not in effect one and the same in this instance? Author would be fine.

Duncan Revell said:

Andy,

I don't know if this will be helpful or not - I wanted something similar a while back and wrote a custom fieldtype. I can't remember if/where I have a copy of the code, but I remember it being actually quite straightforward...!

Thanks Duncan, I will look in to this method.

Drew McLellan said:

Ok, so you don't want to show the current user, but the author of the item, is that right?

Hi Drew,

Sorry, yes, it is the author that I need to show.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is the author a related field?

No, it doesn't exist. I was hoping to use data from the database e.g. itemUpdatedBy. A user logs in and creates an item and that user is then displayed against that item in admin.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That's not possible without writing a field type like Duncan suggests.