Skip to content

Commit 36b13a9

Browse files
committed
Implement nav sort
1 parent 6e7615f commit 36b13a9

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,10 @@ menu:
378378
- orm listeners for linkable models that are in a menu to avoid accidental deletion.
379379
- caching tree model + observer to clear cache
380380
- add menu to default page template
381+
- test global search and improve table search and ordering
382+
383+
page:
384+
- make table searchable, columns orderable, test global search
381385

382386
release:
383387
- policies:

config/filament-flexible-content-block-pages.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
'enable_author' => true,
5353
'enable_parent' => true,
5454
'enable_undeletable' => true,
55+
'navigation_sort' => 5,
5556
],
5657
// If you extend PageResource and want to use your own model, you can add your the extended page resource config for your own model here...
5758
],
@@ -95,6 +96,7 @@
9596
],
9697

9798
'menu' => [
99+
'navigation_sort' => 30,
98100
'max_depth' => 2,
99101
'enable_menu_item_icon_field' => true,
100102
'linkable_models' => [

src/FilamentFlexibleContentBlockPagesConfig.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,16 @@ public function isUndeletableEnabled(string $modelClass): bool
333333
return $this->packageConfig("page_resource.{$modelClass}.enable_undeletable", true);
334334
}
335335

336+
public function getPageNavigationSort(string $modelClass): ?int
337+
{
338+
return $this->packageConfig("page_resource.{$modelClass}.navigation_sort");
339+
}
340+
341+
public function getMenuNavigationSort(): ?int
342+
{
343+
return $this->packageConfig('menu.navigation_sort');
344+
}
345+
336346
private function packageConfig(string $configKey, $default = null): mixed
337347
{
338348
return config('filament-flexible-content-block-pages.'.$configKey, $default);

0 commit comments

Comments
 (0)