Jump to content

Force 'edited' line on Pages record?


Recommended Posts

I'm bumbling around trying to get a last-edited line to show by default on record display. The database is set up wiki-style and I want good visibility of when the last change was made and by whom. 

Members have 'ability to edit silently' turned off at group level. When I edit as admin I see a checkbox to 'Show that the message has been edited' — I guess I'd like the equivalent of having  that checked by default for every user.  If I log in as a test user it doesn't show any edits I make. 

I tried removing the conditional around this part of the display template, to no effect.

    {{if $record->editLine()}} 
				<span class='ipsType_light ipsType_medium ipsType_reset'>

The  conditional in the editLine template seems to apply only to showing the reason. 

	{lang="date_edited" htmlsprintf="\IPS\DateTime::ts( $record->record_edit_time )->html(FALSE), htmlspecialchars( $record->record_edit_member_name, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE )"}
	{{if $record->edit_reason}}

Thanks for any tips. 

Link to comment
Share on other sites

I don't have time to go look at this myself, but my first instinct is that you're looking in the wrong place.  If the setting is to not log the event, editing the skin to always show the last edit date is not going to matter.  You're not going to have any results to return to display there.  

Instead, I would look at the input form of the content or wherever is giving the user the option to uncheck the option to not log the edit.  

Link to comment
Share on other sites

Possibly not, although that depends on what it you mean by "it's" :p By test user I mean an account I use that is assigned non-administrative regular permissions (that is, the same group as club members who would be editing the policy documents that make up this database).  Viewing revision history shows the edits made by all users as expected.  I'd like to make that last user/date slug available in the display template somehow.


Link to comment
Share on other sites

I had a custom code in 3.4 to list the recent contributors to a Wiki record. Haven’t looked into that for 4.x yet. There is nothing in the template normally that shows that. 

The edited line is just meant to show that an admin has made I change I think. It doesn’t show recent Wiki author. 

Link to comment
Share on other sites

Okay, I had a look. I am not seeing the contributors in the record variable. But I do see the last edit, even if its not an admin. 


You can also construct the user link with photo from the ID. 

Link to comment
Share on other sites

  • 3 months later...

I didn't fix it as it seems to be working as expected for me, as near as I can tell.

This is the complete line I have:

<p class='ipsType_right ipsType_light ipsType_medium ipsType_reset ipsPad_half'>  Last edited by $record->record_edit_member_name ({datetime="$record->record_edit_time"})</p>

which gives me the following (which works for my use-case). 

Last edited by Test Case (April 24)


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...