We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Show the author of the last edit of an entry

How Do I?

matthewcarleton's avatar
matthewcarleton
24 posts
2 months ago
matthewcarleton's avatar matthewcarleton

I’m showing the date of the last entry but I’d also like to show the author of that edit.

       
Tom Jaeger's avatar
Tom Jaeger
316 posts
2 months ago
Tom Jaeger's avatar Tom Jaeger

Thanks for getting in touch about this.

Id take a peek at the {author} tag.

https://docs.expressionengine.com/latest/channels/entries.html#author

Thanks,

-Tom Jaeger

       
matthewcarleton's avatar
matthewcarleton
24 posts
2 months ago
matthewcarleton's avatar matthewcarleton

Thanks Tom, I don’t want to show the author of the post I want the author of the most recent edit. I don’t think that tag will work will it?

       
Tom Jaeger's avatar
Tom Jaeger
316 posts
2 months ago
Tom Jaeger's avatar Tom Jaeger

So something like the Author of the “current” revision?

       
matthewcarleton's avatar
matthewcarleton
24 posts
2 months ago
matthewcarleton's avatar matthewcarleton

Yes, I want to show the original author but also the author of the most recent revision

       
matthewcarleton's avatar
matthewcarleton
24 posts
2 months ago
matthewcarleton's avatar matthewcarleton

@tom - any help on this one?

       
Tom Jaeger's avatar
Tom Jaeger
316 posts
2 months ago
Tom Jaeger's avatar Tom Jaeger

Off the top of my head, my gut reaction is that it would be fairly easy to do with the query module (not sure how well you know SQL).

https://docs.expressionengine.com/latest/add-ons/query.html

This is something we would consider adding if you wanted to open an issue on github https://github.com/ExpressionEngine/ExpressionEngine

       
matthewcarleton's avatar
matthewcarleton
24 posts
2 months ago
matthewcarleton's avatar matthewcarleton

ok, ya It feels like a nice RFE - I’ll open an issue.

In the meantime I might try the SQL approach

       
matthewcarleton's avatar
matthewcarleton
24 posts
2 months ago
matthewcarleton's avatar matthewcarleton

https://github.com/ExpressionEngine/ExpressionEngine/issues/2591

       
matthewcarleton's avatar
matthewcarleton
24 posts
2 months ago
matthewcarleton's avatar matthewcarleton

Found this query works pretty well

{exp:query sql="SELECT exp_members.screen_name AS revision_author, exp_entry_versioning.version_date FROM exp_entry_versioning JOIN exp_members ON exp_entry_versioning.author_id=exp_members.member_id WHERE entry_id='{entry_id}' ORDER BY version_date DESC LIMIT 1"}

        <li>Last Edit: {version_date format="%m/%d/%Y"}</li>
        <li>Author: {revision_author}</li>

    {/exp:query}
       
matthewcarleton's avatar
matthewcarleton
24 posts
about 2 months ago
matthewcarleton's avatar matthewcarleton

@tom, not sure how good your SQL is but I’m trying to also pull the avatar url for the revision author, any ideas?

       
matthewcarleton's avatar
matthewcarleton
24 posts
one month ago
matthewcarleton's avatar matthewcarleton

Anyone else able to help with this?

       
Tom Jaeger's avatar
Tom Jaeger
316 posts
4 weeks ago
Tom Jaeger's avatar Tom Jaeger

HI Matthew,

I think I saw this one answered in slack.. so I thought I’d drop the answer in here for anyone following along..

{exp:query sql="SELECT exp_members.screen_name AS revision_author, exp_entry_versioning.version_date, exp_members.avatar_filename as avatar FROM exp_entry_versioning JOIN exp_members ON exp_entry_versioning.author_id=exp_members.member_id WHERE entry_id='{entry_id}' ORDER BY version_date DESC LIMIT 1"}
<a href="/avatart-upload-file-path/{avatar}">Avatar</a>
{/exp:query}
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.