Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
feb6f87
Make actions available in a collection tree view
Devsome Mar 24, 2026
6dc7141
fix: duplicate deletion removed
Devsome Mar 24, 2026
5561d3f
Merge branch 'statamic:6.x' into 6.x
Devsome Mar 25, 2026
ff414fa
Merge branch 'statamic:6.x' into 6.x
Devsome Mar 26, 2026
9867b35
Merge branch 'statamic:6.x' into 6.x
Devsome Mar 29, 2026
d84b469
Merge branch 'statamic:6.x' into 6.x
Devsome Apr 2, 2026
ae30a9a
Merge branch 'statamic:6.x' into 6.x
Devsome Apr 7, 2026
d87a18c
[6.x] add the autoLoad option to ItemActions and load actions when th…
Devsome Apr 7, 2026
ccaf0d9
Merge branch 'statamic:6.x' into 6.x
Devsome Apr 8, 2026
9c8419a
Merge branch 'statamic:6.x' into 6.x
Devsome Apr 9, 2026
f5a3e1a
Merge branch 'statamic:6.x' into 6.x
Devsome Apr 14, 2026
fd21681
[6.x] fixed modal after action click and variant to default instead o…
Devsome Apr 14, 2026
7be9048
Merge branch 'statamic:6.x' into 6.x
Devsome Apr 15, 2026
a623274
[6.x] Add branch-options-dropdown slot and modal prop to support conf…
Devsome Apr 15, 2026
8763761
Merge branch 'statamic:6.x' into 6.x
Devsome Apr 17, 2026
cbd5921
Merge branch 'statamic:6.x' into 6.x
Devsome May 5, 2026
23b5fcc
Merge branch 'statamic:6.x' into 6.x
Devsome May 11, 2026
a9dcc8b
Merge branch 'statamic:6.x' into 6.x
Devsome May 12, 2026
47a052b
Merge branch 'statamic:6.x' into 6.x
Devsome May 15, 2026
11f5cd9
Merge branch 'statamic:6.x' into 6.x
Devsome Jun 9, 2026
bee0ed7
Merge branch 'statamic:6.x' into 6.x
Devsome Jun 16, 2026
b547828
Merge branch 'statamic:6.x' into 6.x
Devsome Jun 25, 2026
940fc55
Merge branch 'statamic:6.x' into 6.x
Devsome Jul 2, 2026
1f3d9e6
Merge branch 'statamic:6.x' into 6.x
Devsome Jul 6, 2026
2d313cf
Merge branch 'statamic:6.x' into 6.x
Devsome Jul 9, 2026
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
22 changes: 22 additions & 0 deletions resources/js/pages/collections/Show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,24 @@
variant="destructive"
@click="deleteTreeBranch(branch, removeBranch)"
/>
<template v-if="branchTreeActions(branch).length">
<DropdownSeparator />
<ItemActions
:url="entriesActionUrl"
:actions="branchTreeActions(branch)"
:item="branch.entry"
v-slot="{ actions }"
>
<DropdownItem
v-for="action in actions"
:key="action.handle"
:text="__(action.title)"
:icon="action.icon"
:variant="action.dangerous ? 'destructive' : undefined"
@click="action.run()"
/>
</ItemActions>
</template>
</template>
</page-tree>

Expand Down Expand Up @@ -397,6 +415,10 @@ export default {
return branch.redirect != null;
},

branchTreeActions(branch) {
return (branch.actions || []).filter((action) => action.handle !== 'delete');
},

createEntry(blueprint, parent) {
let url = `${this.createUrl}?blueprint=${blueprint}`;
if (parent) url += '&parent=' + parent;
Expand Down
23 changes: 17 additions & 6 deletions src/Structures/TreeBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Statamic\Structures;

use Statamic\Contracts\Structures\Nav;
use Statamic\Facades\Action;
use Statamic\Facades\Entry;
use Statamic\Facades\Structure;
use Statamic\Facades\User;
Expand Down Expand Up @@ -91,22 +92,32 @@ protected function transformTreeForController($tree)
$page = $item['page'];
$collection = $page->mountedCollection();
$referenceExists = $page->referenceExists();
$entry = $referenceExists ? $page->entry() : null;

$actionContext = ['view' => 'tree'];
if ($collection) {
$actionContext['collection'] = $collection->handle();
}
if ($entry) {
$actionContext['site'] = $entry->locale();
}

return [
'id' => $page->id(),
'entry' => $page->reference(),
'title' => $page->hasCustomTitle() ? $page->title() : null,
'entry_title' => $referenceExists ? $page->entry()->value('title') : null,
'entry_blueprint' => $referenceExists ? [
'handle' => $page->entry()->blueprint()->handle(),
'title' => $page->entry()->blueprint()->title(),
'entry_title' => $entry ? $entry->value('title') : null,
'entry_blueprint' => $entry ? [
'handle' => $entry->blueprint()->handle(),
'title' => $entry->blueprint()->title(),
] : null,
'url' => $page->url(),
'edit_url' => $page->editUrl(),
'can_delete' => $referenceExists ? User::current()->can('delete', $page->entry()) : true,
'can_delete' => $entry ? User::current()->can('delete', $entry) : true,
'slug' => $page->slug(),
'status' => $referenceExists ? $page->status() : null,
'redirect' => $referenceExists ? $page->entry()->get('redirect') : null,
'redirect' => $entry ? $entry->get('redirect') : null,
'actions' => $entry ? Action::for($entry, $actionContext) : [],
'collection' => ! $collection ? null : [
'handle' => $collection->handle(),
'title' => $collection->title(),
Expand Down
Loading