https://github.com/bnomei/kirby3-recently-modified
Kirby Section to display recently modified content pages by current User
https://github.com/bnomei/kirby3-recently-modified
changes kirby kirby-4 kirby-5 kirby-cms kirby-plugin list modified page pages recently user widget
Last synced: about 1 month ago
JSON representation
Kirby Section to display recently modified content pages by current User
- Host: GitHub
- URL: https://github.com/bnomei/kirby3-recently-modified
- Owner: bnomei
- License: mit
- Created: 2022-04-16T17:49:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-23T15:05:23.000Z (8 months ago)
- Last Synced: 2025-06-24T18:08:31.852Z (4 months ago)
- Topics: changes, kirby, kirby-4, kirby-5, kirby-cms, kirby-plugin, list, modified, page, pages, recently, user, widget
- Language: PHP
- Homepage: https://forum.getkirby.com/t/kirby-3-recently-modified-show-edited-pages-by-current-panel-user/25274
- Size: 1.56 MB
- Stars: 29
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kirby Recently Modified

[](https://discordapp.com/users/bnomei)
[](https://www.buymeacoffee.com/bnomei)Kirby Plugin to view recently modified pages by current User
## Installation
- unzip [master.zip](https://github.com/bnomei/kirby3-recently-modified/archive/master.zip) as folder `site/plugins/kirby3-recently-modified` or
- `git submodule add https://github.com/bnomei/kirby3-recently-modified.git site/plugins/kirby3-recently-modified` or
- `composer require bnomei/kirby3-recently-modified`## Screenshot
### Section
### Field
## Usage
Add the section to your site or page blueprint to display a list of the most recently modified pages by the currently logged in user. The sections is not able to list the site itself since the section depends on a collection of pages for the query.
**site/blueprints/site.yml**
```yaml
sections:
listPagesModifiedByUser:
type: recentlymodified
headline: Your Recently Modified Pages
# query
```Optionally you can add the field to the site or any page blueprint to show the time and user that modified given content most recently. In contrast to the section the field is able to show most recent modified information for the site (`content/site.txt`).
**site/blueprints/pages/default.yml**
```yaml
fields:
showWhichUserModifiedPage:
type: recentlymodified
label: Recently Modified By
# interval: 60
```> [!WARNING]
> This plugin has, by default, a 1 minute cache.### Query for the Section (not Field)
The plugins section comes with a default query that shows the most recent changes made by the currently logged in user. But you can define any other query you like.
**Default Query**
```
site.index(true).sortBy('modified', 'desc').onlyModifiedByUser
```> `onlyModifiedByUser` is a PagesMethod added by this plugin that filters the page collection to only those pages that were modified by the currently logged-in user. The plugin uses hooks to track what pages each user did edit.
**Example 1**
```yaml
sections:
recentarticles:
type: recentlymodified
headline: Recently Modified Articles
query: site.find('articles').children.listed.sortBy('modified', 'desc')
```**Example 2**
```yaml
sections:
mycollection:
type: recentlymodified
headline: My Collection
query: kirby.collection('my-collection')
```
```php
return [
'bnomei.recently-modified.limit' => 25, // default: 7
'bnomei.recently-modified.info' => function ($page) {
return $page->id();
},
// other options...
];
```> TIP: You could use the `query` property, `info` and `limit` settings to show any list of pages you want, just like a simplified version of the page table plugin.
## Adjusting the Date formats
You can adjust the date formats based on the `date.handler` option. The default is `date`. The plugin `bnomei.recently-modified.format` is a callback that takes the `$datetime` string to format and ideally provides a format for all possible date handlers, returning the formatted string.
**site/config/config.php**
```php
[
'handler' => 'date', //