PHPackages                             goldfinch/loadmore - 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. goldfinch/loadmore

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

goldfinch/loadmore
==================

Load more implementation for Silverstripe with front-end component

v2.0.1(2y ago)0354MITPHPPHP &gt;=8.0

Since Jan 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/goldfinch/loadable)[ Packagist](https://packagist.org/packages/goldfinch/loadmore)[ RSS](/packages/goldfinch-loadmore/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (20)Used By (0)

🦅 Loadable objects for Silverstripe
===================================

[](#-loadable-objects-for-silverstripe)

[![Silverstripe Version](https://camo.githubusercontent.com/a798a57963ddebe0c33c27c757b7722fc95a0a6cc52f7c1839a90238934cafe4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53696c7665727374726970652d253545352e312d3030356165312e7376673f6c6162656c436f6c6f723d7768697465266c6f676f436f6c6f723d666666666666266c6f676f3d646174613a696d6167652f7376672b786d6c3b6261736536342c50484e325a79423462577875637a30696148523063446f764c336433647935334d793576636d63764d6a41774d43397a646d636949485a705a58644362336739496a41674d4341784d4445754d446b78494455344c6a55314e5349675a6d6c7362443069497a41774e57466c4d53496765473173626e4d36646a30696148523063484d364c7939325a574e30595335706279397559573576496a3438634746306143426b50534a4e4e5441754d444531494455754f445534624330794d5334794f444d674d5451754f5745324c6a55674e693431494441674d434177494463754e445134494445774c6a59314e4777794d5334794f444d744d5451754f574d344c6a67784d7930324c6a4533494449774c6a6b324c5451754d444934494449334c6a457a494451754e7a6732637a51754d444934494449774c6a6b324c5451754e7a6731494449334c6a457a624330324c6a59354d5341304c6a59334e6d4d314c6a55304d6941354c6a51784f4341784f4334774e7a67674e5334304e5455674d6a4d754e7a637a4c5451754e6a553051544d794c6a513349444d794c6a5133494441674d434177494455774c6a41784e5341314c6a67324d6e70744d5334774e5467674e4459754f444933624449784c6a49344e4330784e433435595459754e5341324c6a55674d434178494441744e7934304e446b744d5441754e6a557a5444517a4c6a59794d7941304d6934774d6a686a4c5467754f44457a494459754d5463744d6a41754f545535494451754d4449354c5449334c6a45794f5330304c6a63344e484d744e4334774d6a6b744d6a41754f545535494451754e7a67304c5449334c6a45794f5777324c6a59354d5330304c6a59334e6b4d794d6934304d79307a4c6a6b334e6941354c6a67354e4330754d44457a494451754d546b34494445774c6a41354e6d457a4d6934304e79417a4d6934304e794177494441674d4341304e6934344e7a55674e4449754e546b7965694976506a777663335a6e50673d3d)](https://packagist.org/packages/goldfinch/loadable)[![Package Version](https://camo.githubusercontent.com/86627a36c6f152d2d0f161bc5689703b20ad7dd1e308a53d4a0ad439eeabba9e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676f6c6466696e63682f6c6f616461626c652e7376673f6c6162656c436f6c6f723d33333326636f6c6f723d463843363330266c6162656c3d56657273696f6e)](https://packagist.org/packages/goldfinch/loadable)[![Total Downloads](https://camo.githubusercontent.com/990d5f708e8dfcdcfc6d34e700a6932e1f4997d0fa85443bde2b0dd2f284444f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676f6c6466696e63682f6c6f616461626c652e7376673f6c6162656c436f6c6f723d33333326636f6c6f723d463843363330266c6162656c3d446f776e6c6f616473)](https://packagist.org/packages/goldfinch/loadable)[![License](https://camo.githubusercontent.com/6da9862038cbcaa5d6a3ead793b1538993c6075d5ace83ff2303c5cb968eda23/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f676f6c6466696e63682f6c6f616461626c652e7376673f6c6162656c436f6c6f723d33333326636f6c6f723d463843363330266c6162656c3d4c6963656e7365)](https://packagist.org/packages/goldfinch/loadable)

**Load more** implementation ⏳ for Silverstripe with front-end component 🌀. Easy to use and customize.

[![Screenshot](screenshots/loadmore.jpeg)](screenshots/loadmore.jpeg)

Available Taz commands
----------------------

[](#available-taz-commands)

If you haven't used [**Taz**](https://github.com/goldfinch/taz)🌪️ before, *taz* file must be presented in your root project folder `cp vendor/goldfinch/taz/taz taz`

---

> Extend model making it loadable

```
php taz loadable
```

> Create loadable template

```
php taz make:loadable-template
```

Install
-------

[](#install)

#### 1. Install module

[](#1-install-module)

```
composer require goldfinch/loadable
```

#### 2. Add key to your **.env**

[](#2-add-key-to-your-env)

Use [**Taz**](https://github.com/goldfinch/taz)🌪️ to generate and add the key.

```
php taz generate:app-key
```

#### 3. Generate config file

[](#3-generate-config-file)

Use [**Taz**](https://github.com/goldfinch/taz)🌪️ to generate the config. It will quickly lead you through the setup and take care of it for you.

```
php taz loadable
```

#### 4. Make sure these meta tags are presented in your header

[](#4-make-sure-these-meta-tags-are-presented-in-your-header)

```

```

#### 5. Implement JavaScript front-end component

[](#5-implement-javascript-front-end-component)

*via Silverstripe Requirements PHP*

```
Requirements::javascript('goldfinch/loadable:client/dist/loadable.js');
```

*via template require*

```

```

*via ES6 module*

```
import Loadable from '..../vendor/goldfinch/loadable/client/src/src/loadable-mod';
// import Loadable from '@goldfinch/loadable/client/src/src/loadable-mod'; // with alias

document.addEventListener('DOMContentLoaded', () => {
  new Loadable();
});
```

```
// vite.config.js
// * only if you use alias import above

import { defineConfig } from 'vite';

export default defineConfig(({ command, mode }) => {

  return {

    // ..

    resolve: {
      alias: [
        { find: '@goldfinch', replacement: fileURLToPath(new URL('./vendor/goldfinch', import.meta.url)) },
      ],
    },

    // ..

  };
});
```

#### 6. Create a loadable template (FYI)

[](#6-create-a-loadable-template-fyi)

The **Taz** command in [the third step](https://github.com/goldfinch/loadable?tab=readme-ov-file#3-generate-config-file) above would create the loadable template for your model so you don't really need to do anything here. Just for your information, if you are curious about how the templates initiate:

All loadable templates are stored within a single folder `templates/Loadable`. The name should be the same as your targeted model's name.

*Example:*

Loadable template for `app/Models/MyLoadableModel.php`would be `themes/my_theme/templates/Loadable/MyLoadableModel.ss`

(❗) The content in each template must start with a tag that has `data-loadable-list-item` attribute which represents a single loadable item

```

```

*Real-case example:*

```

  $Image
  $Title

```

Usage
-----

[](#usage)

To call the loadable area use one of the examples below for further customization

#### Method 1 (quick preview for test)

[](#method-1-quick-preview-for-test)

```
$LoadableAs(App\Models\MyLoadableModel)
```

#### Method 2 (basic)

[](#method-2-basic)

```

    $List

      $Action

```

#### Method 3 (fully customizable)

[](#method-3-fully-customizable)

```

        $loadableTemplate

        Load more

```

#### Method 4 (bridge - list through class method)

[](#method-4-bridge---list-through-class-method)

To use this method, we need to do a few more settings:

1. Call loadable instance passing $ID and $Method

```
$LoadableAs(App\Models\ProjectCategory, $ProjectCategoryID, Projects)
$LoadableWith(App\Models\ProjectCategory, $ProjectCategoryID, Projects)
```

- `Projects` in this example is a method in `ProjectCategory` model that returns `DataList`. It could be basic custom method or `has_many`/`many_many`/`belongs_many_many`

```
class ProjectCategory {

    // as relationship
    private static $belongs_many_many = [
        'Projects' => ProjectItem::class,
    ];

    // or as custom method
    public function Projects()
    {
        // return $this->Projects();
        return ProjectItem::get();
    }
}
```

2. Add `bridge` to our config:

```
Goldfinch\Loadable\Loadable:
  loadable:
    App\Models\ProjectItem:
      initial_loaded: 10
      per_each_load: 10
      bridge:
        App\Models\ProjectCategory: Projects
```

Other options
-------------

[](#other-options)

Properties like `initial_loaded`, `per_each_load` can be declared in database instead. Using [SomeConfig](https://github.com/jonom/silverstripe-someconfig). If you use [**Taz**](https://github.com/goldfinch/taz)🌪️ command `php taz loadable`, it will handle this setup for you anyway, but for your reference:

1. We need to specify `dbconfig` in our config as shown in the example below

```
Goldfinch\Loadable\Loadable:
  loadable:
    App\Models\MyLoadableModel:
      dbconfig:
        App\Configs\MyConfig:
          initial_loaded: InitialLoaded
          per_each_load: PerEachLoad
```

2. Based on the example above, our *MyConfig* class would look like this:

```
use JonoM\SomeConfig\SomeConfig;
use SilverStripe\ORM\DataObject;
use SilverStripe\View\TemplateGlobalProvider;

class MyConfig extends DataObject implements TemplateGlobalProvider
{
    use SomeConfig;

    private static $db = [
        'InitialLoaded' => 'Int(10)',
        'PerEachLoad' => 'Int(10)',
    ];
}
```

Sidenotes
---------

[](#sidenotes)

*manually extended model*

If you don't want to use `LoadableExtension` extension, you can prepare your loadable model

```
use SilverStripe\ORM\DataList;
use SilverStripe\Control\HTTPRequest;

public static function loadable(DataList $list, HTTPRequest $request, $data, $config): DataList
{
    // apply some additional filtering to the list as needed

    return $list;
}

public function loadableTemplate()
{
    return $this->renderWith('Loadable/MyLoadableModel');
}
```

Events
------

[](#events)

Available JavaScript callback events

```
window.goldfinch.loadmore_before_callback = (action) => {
  console.log('loadmore before', action)

  let list = action.closest('[data-loadable-area]').children('[data-loadable-list]')

  // ..
}

window.goldfinch.loadmore_after_callback = (action) => {
  console.log('loadmore after', action)

  let list = action.closest('[data-loadable-area]').children('[data-loadable-list]')

  // ..
}
```

License
-------

[](#license)

The MIT License (MIT)

###  Health Score

26

↓

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Recently: every ~23 days

Total

19

Last Release

730d ago

Major Versions

v1.0.16 → v2.0.02024-03-07

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2291826?v=4)[goldfinch](/maintainers/goldfinch)[@goldfinch](https://github.com/goldfinch)

---

Top Contributors

[![goldfinch](https://avatars.githubusercontent.com/u/2291826?v=4)](https://github.com/goldfinch "goldfinch (48 commits)")

---

Tags

silverstripeload moreloadmoreloadableloadmore-silverstripeloadable-silverstripeloadable-dataobjectloadmore-dataobject

### Embed Badge

![Health badge](/badges/goldfinch-loadmore/health.svg)

```
[![Health](https://phpackages.com/badges/goldfinch-loadmore/health.svg)](https://phpackages.com/packages/goldfinch-loadmore)
```

###  Alternatives

[silverstripe/subsites

Run multiple sites from a single SilverStripe install.

65392.9k20](/packages/silverstripe-subsites)[symbiote/silverstripe-advancedworkflow

Adds configurable workflow support to the CMS, with a GUI for creating custom workflow definitions.

46295.2k7](/packages/symbiote-silverstripe-advancedworkflow)[silverstripe/taxonomy

Provide extra taxonomy for cataloguing the data.

10481.5k19](/packages/silverstripe-taxonomy)[wedevelopnl/silverstripe-elemental-grid

Elemental grid module

1014.1k2](/packages/wedevelopnl-silverstripe-elemental-grid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
