feat: restore sablog browse modes and clean imported HTML
Keep the public site readable after import (nbsp, highlighter, wrapping code, compact pager) and finish the admin extras already in this tree: sticky levels, preview, page cache, and live llms.txt. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+8
-9
@@ -103,21 +103,20 @@ class ServiceProvider extends PluginServiceProvider
|
||||
|
||||
核心资源的表单/表格会触发 `filament.post_form` / `filament.post_table` 两个钩子,插件可追加自己的字段与列,停用插件后字段自动消失,核心零侵入。
|
||||
|
||||
> 注意:`Schema::components()` 与 `Table::columns()` 都是**整体替换**语义,追加要这样写:
|
||||
> 文章编辑页是 **左正文 2 : 右功能 1**。插件不要往根节点再追加整行 Section,否则会把 2:1 挤掉。
|
||||
>
|
||||
> - 表单:`$schema->components([...$schema->getComponents(), Section::make(...)])`
|
||||
> - 表单:用 `PostForm::appendToSidebar()` / `PostForm::appendToAccessSection()`
|
||||
> - 表格:`$table->pushColumns([...])`
|
||||
|
||||
示例(给文章加「付费设置」):
|
||||
示例(给右侧「访问设置」加会员字段):
|
||||
|
||||
```php
|
||||
use App\Filament\Resources\Posts\Schemas\PostForm;
|
||||
|
||||
$manager->addAction('filament.post_form', function (Schema $schema) {
|
||||
$schema->components([
|
||||
...$schema->getComponents(),
|
||||
Section::make('付费设置')->columns(3)->collapsible()->schema([
|
||||
TextInput::make('meta.price')->label('单篇价格(分)')->numeric()->default(0),
|
||||
Toggle::make('meta.members_only')->label('会员专享'),
|
||||
]),
|
||||
PostForm::appendToAccessSection($schema, [
|
||||
TextInput::make('meta.price')->label('价格')->numeric()->default(0),
|
||||
Toggle::make('meta.members_only')->label('会员专享'),
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user