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

Showing when an entry is updated/revised

Development and Programming

jordan-sowers's avatar
jordan-sowers
2 posts
12 years ago
jordan-sowers's avatar jordan-sowers

Hello,

Curios if there is a way that you can show when a member edits an entry?

I would like to show this entry update within the channel:entries tag, but not sure if its possible.

Any thoughts or solutions are greatly appreciated.

Thanks!

       
travisb's avatar
travisb
172 posts
12 years ago
travisb's avatar travisb

Would the edit_date variable help you? If you wanted to show when the entry was edited you can use something like:

{edit_date format="%Y %m %d"}

http://ellislab.com/expressionengine/user-guide/modules/channel/channel_entries.html#edit-date

       
jordan-sowers's avatar
jordan-sowers
2 posts
12 years ago
jordan-sowers's avatar jordan-sowers

Thanks for your response!

I’ve seen that before..but, I’m looking to see if there is a way to have that entry show multiple times within the channel entries tag.

For example:

Post A: Created April 1st Post B Post C Post A: Updated April 4th

This might not be possible, but the idea is that I have members updating entries through Safecracker and am looking for a way to have their updates show within the channel entries field.

Thanks again,

Jordan

       
travisb's avatar
travisb
172 posts
12 years ago
travisb's avatar travisb

So it looks like you want to take all the Post entries and sort them by the combined ‘created’ and ‘updated’ fields. Unless someone knows of an add-on that accomplishes this, you’re probably looking at bypassing the template entries loop doing some type of mysql self join (for example http://www.w3resource.com/sql/joins/perform-a-self-join.php ). Or enabling php for your template and setting and sorting arrays from the EE entry output. There may be a way to do this with the Stash add-on https://github.com/croxton/Stash or something similar.

       
Bhashkar Yadav's avatar
Bhashkar Yadav
727 posts
12 years ago
Bhashkar Yadav's avatar Bhashkar Yadav

Hi Jordan,

It’s possible with feature of entry revision. So first you need to check “Enable Entry Versioning” from the channel preferences and set the “Maximum Number of Recent Revisions per Entry”.

Now by using the query module you can write the query like:

{exp:query sql="SELECT version_date, 
 SUBSTRING_INDEX(SUBSTRING_INDEX(version_data,';', 16),':',-1) AS entry_id, 
 SUBSTRING_INDEX(SUBSTRING_INDEX(version_data,';', 22),':',-1) AS title, 
 SUBSTRING_INDEX(SUBSTRING_INDEX(version_data,';', 30),':',-1) AS url_title
FROM exp_entry_versioning
WHERE channel_id=1 AND author_id=1 
ORDER BY version_date DESC"}

{entry_id} :: {title} :: {url_title} :: {version_date format="%d-%m-%Y"}

{/exp:query}

See the channel_id and author_id in the WHERE condition of query. You need to update it accordingly.

Please Note: Above query will work properly for the entries submitted via Safecraker.

I hope, it would help you.

       
Bhashkar Yadav's avatar
Bhashkar Yadav
727 posts
12 years ago
Bhashkar Yadav's avatar Bhashkar Yadav

I developed a plugin “Entry Revisions” for this purpose. One can download from here: http://www.sidd3.com/entry-revisions-plugin/

       
Bookel's avatar
Bookel
1 posts
one year ago
Bookel's avatar Bookel

To display when a member edits an entry within the channel:entries tag in ExpressionEngine, you can use the edit_date variable, which shows the date and time of the last edit made to the entry. Here’s how you can incorporate it into your template:

{exp:channel:entries channel="your_channel"}

{title}

{if edit_date} Last Edited: {edit_date format="%Y-%m-%d %H:%i:%s"} {/if} {body} {/exp:channel:entries}

In the above example, {edit_date format="%Y-%m-%d %H:%i:%s"} will output the edit date in a format like 2024-06-05 06:34:46. You can customize the date and time format according to your needs using standard PHP date format characters.

For more advanced usage, if you want to track and display a history of edits, you might need to implement additional custom functionality or use an add-on that provides audit trail capabilities.

       

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.