Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions content/collections/extending-docs/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,25 @@ public function handle(EntryBlueprintFound $event)
}
```

You can also use this to replace the whole blueprint content.
An example would be if you have a collection that should use a blueprint from another collection.

```php
use Statamic\Facades\Blueprint;

public function handle(EntryBlueprintFound $event)
{
if ($event->blueprint->fullyQualifiedHandle() === 'collections.subpages.subpage') {
$pageBlueprint = Blueprint::find('collections.pages.page');

$event->blueprint->setContents($pageBlueprint->contents());

// The entrys blueprint would be `subpage`, but the blueprint
// fields etc. would be the same as in `page`.
}
}
```

### EntryCreated
`Statamic\Events\EntryCreated`

Expand Down