Stefanowitsch Posted August 10 Share Posted August 10 Hi @bernhard! I don't know if this is a RockFrontend or RockPageBuilder related question (or maybe only PageFrontEdit?). But here we go: In the PW backend I can see unter the "settings" tab of a page which user modified this page recently: $modifiedFormatted = date("d.m.y H:i", $page->modified); $lastModifiedByUser = $page->modifiedUser->name; Is it possible to display this information when editing a RPB Block in a modal window, for example on the top? Something like this: 1 Link to comment Share on other sites More sharing options...
bernhard Posted August 11 Share Posted August 11 What do you think of showing a warning if the block has been modified < 5min by another user by default? Link to comment Share on other sites More sharing options...
Stefanowitsch Posted August 11 Author Share Posted August 11 4 hours ago, bernhard said: What do you think of showing a warning if the block has been modified < 5min by another user by default? I just want to see which user did the latest changes on a specific block. In the backend page tree I modified the view like this: This works for pages but you can not see which page builder block (inside those pages) has been edited by which user. Link to comment Share on other sites More sharing options...
bernhard Posted August 20 Share Posted August 20 Here you go: wire()->addHookAfter('ProcessPageEdit::buildForm', function ($event) { $page = $event->object->getPage(); if (!$page instanceof \RockPageBuilder\Block) return; $form = $event->return; $user = $page->modifiedUser->name; $relativeTime = wire()->datetime->relativeTimeStr($page->modified); $form->prepend(rockmigrations()->inputfield([ 'type' => 'markup', 'label' => 'Block Info', 'icon' => 'clock-o', 'value' => "Zuletzt bearbeitet von: $user ($relativeTime)", ])); }); This will show the info for all blocks, but you can define conditions as you need on the $page object. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now