pechente/kirby-admin-bar
Composer 安装命令:
composer require pechente/kirby-admin-bar
包简介
Kirby Admin Bar
README 文档
README
Kirby Admin Bar provides a simple admin bar for your frontend. It allows logged-in users to quickly edit the current page and navigate to other important pages of the panel.
Please note that this plugin might disable Kirby staticache since it renders different content for logged-in users and guests.
Installation
Download
Download and copy this repository to /site/plugins/kirby-admin-bar.
Git submodule
git submodule add https://github.com/pechente/kirby-admin-bar.git site/plugins/kirby-admin-bar
Composer
composer require pechente/kirby-admin-bar
Setup
Install the plugin and enable it in your config.php:
return [ 'ready' => function ($kirby) { return [ 'pechente.kirby-admin-bar' => [ 'active' => $kirby->user() !== null ] ]; }, ]
Enabling the plugin this way will automatically insert it before the closing body tag for logged-in users.
By default, the admin bar has a fixed position which might cause it to overlap your header / content. Kirby Admin Bar provides a CSS variable to offset your header accordingly, i.e.:
.header { position: fixed; top: var(--admin-bar--height, 0); /* ... */ }
Additionally, Admin Bar relies on a bunch of CSS variables that you can overwrite to customize the look:
:root { --admin-bar--font-family: -apple-system, "system-ui", "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; --admin-bar--base-font-size: 14px; --admin-bar--base-line-height: 1.2; --admin-bar--height: 48px; --admin-bar--z-index: 110; --admin-bar--avatar-size: 32px; --admin-bar--border-radius: 4px; --admin-bar--position: fixed; --admin-bar--padding: 0 16px; --admin-bar--icon-size: 18px; --admin-bar--dropdown-border-radius: 4px; }
Dealing with virtual pages
The edit link will not work for virtual pages. In these cases, you can disable the edit button by returning the field disableEditButton from the page, i.e.:
'routes' => [ [ 'pattern' => 'virtual', 'action' => function () { return Page::factory([ // ... 'content' => [ // ... 'disableEditButton' => true, // Will disable the edit button ] ]); } ] ]
Sometimes however, your virtual page is being fed by another page like a settings page. In this case, you can overwrite the URL of the edit link instead of disabling it completely, like so:
'routes' => [ [ 'pattern' => 'virtual', 'action' => function () { return Page::factory([ // ... 'content' => [ // ... 'panelUrl' => Panel::url('settings') // Set a custom link here - could even be an external URL ] ]); } ] ]
Both panelUrl and disableEditButton are read as page fields and can therefore even be created as regular fields in a blueprint so can fill them out through the panel or create them as pre-filled hidden fields.
License
Credits
pechente/kirby-admin-bar 适用场景与选型建议
pechente/kirby-admin-bar 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.8k 次下载、GitHub Stars 达 53, 最近一次更新时间为 2024 年 11 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「admin」 「panel」 「frontend」 「kirby-plugin」 「kirby-cms」 「kirby4」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 pechente/kirby-admin-bar 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pechente/kirby-admin-bar 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 pechente/kirby-admin-bar 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
2lenet/EasyAdminPlusBundle
Query filtering in your frontend
Analysis module for finding problematical shop data.
Yii2 panel widget
Article CSS-ID Frontend Output Optimization
A Laravel Admin Package for The Control Group to make your life easier and steer your project in the right direction
统计信息
- 总下载量: 2.8k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 53
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-11-10