PHPackages                             bnomei/kirby3-recently-modified - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bnomei/kirby3-recently-modified

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

bnomei/kirby3-recently-modified
===============================

Kirby Section to display recently modified content pages

5.1.0(1mo ago)3210.6k↓49.8%1MITPHP

Since Apr 16Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/bnomei/kirby3-recently-modified)[ Packagist](https://packagist.org/packages/bnomei/kirby3-recently-modified)[ RSS](/packages/bnomei-kirby3-recently-modified/feed)WikiDiscussions main Synced yesterday

READMEChangelog (10)Dependencies (2)Versions (26)Used By (0)

Kirby Recently Modified
=======================

[](#kirby-recently-modified)

[![Release](https://camo.githubusercontent.com/050229fc98c181df4e7349242d72a40f7b93c7cfc05c536e22e4452bd086b2bf/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f762f626e6f6d65692f6b69726279332d726563656e746c792d6d6f6469666965643f636f6c6f723d6165383166662669636f6e3d676974687562266c6162656c)](https://camo.githubusercontent.com/050229fc98c181df4e7349242d72a40f7b93c7cfc05c536e22e4452bd086b2bf/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f762f626e6f6d65692f6b69726279332d726563656e746c792d6d6f6469666965643f636f6c6f723d6165383166662669636f6e3d676974687562266c6162656c)[![Discord](https://camo.githubusercontent.com/36eaef1b06f4996feb7587aa3281dcbd658e57535bc6b5e10110ed108e7a7a03/68747470733a2f2f666c61742e62616467656e2e6e65742f62616467652f646973636f72642f626e6f6d65693f636f6c6f723d3732383964612669636f6e3d646973636f7264266c6162656c)](https://discordapp.com/users/bnomei)[![Buymecoffee](https://camo.githubusercontent.com/62e55d1129b82bf9c2fd4656451e81ab87a9787e7c9676ca58276532ed9666ee/68747470733a2f2f666c61742e62616467656e2e6e65742f62616467652f69636f6e2f646f6e6174653f69636f6e3d6275796d6561636f6666656526636f6c6f723d464638313346266c6162656c)](https://www.buymeacoffee.com/bnomei)

Kirby Plugin to view recently modified pages by current User

Installation
------------

[](#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
----------

[](#screenshot)

### Section

[](#section)

[![recently-modified](https://raw.githubusercontent.com/bnomei/kirby3-recently-modified/master/screenshot.png)](https://raw.githubusercontent.com/bnomei/kirby3-recently-modified/master/screenshot.png)

### Field

[](#field)

[![recently-modified](https://raw.githubusercontent.com/bnomei/kirby3-recently-modified/master/screenshot.gif)](https://raw.githubusercontent.com/bnomei/kirby3-recently-modified/master/screenshot.gif)

Usage
-----

[](#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**

```
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**

```
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)

[](#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**

```
sections:
  recentarticles:
    type: recentlymodified
    headline: Recently Modified Articles
    query: site.find('articles').children.listed.sortBy('modified', 'desc')
```

**Example 2**

```
sections:
  mycollection:
    type: recentlymodified
    headline: My Collection
    query: kirby.collection('my-collection')
```

```
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
--------------------------

[](#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**

```
