roots/acorn-fse-helper
Composer 安装命令:
composer require roots/acorn-fse-helper
包简介
Bootstrap FSE support in Acorn-based WordPress themes.
README 文档
README
Acorn FSE Helper provides an easy way to initialize and work with block templates in themes powered by Acorn.
Support us
Roots is an independent open source org, supported only by developers like you. Your sponsorship funds WP Packages and the entire Roots ecosystem, and keeps them independent. Support us by purchasing Radicle or sponsoring us on GitHub — sponsors get access to our private Discord.
Requirements
Installation
Install via Composer:
$ composer require roots/acorn-fse-helper
Getting Started
Once installed, begin by initializing full-site editing in your theme using Acorn's CLI:
$ wp acorn fse:init
Initializing ensures your current activated theme supports block-templates as well as provides you with the option to publish initial stubs to get started with.
Usage
Once initialized, any block templates located in templates/ will be given priority over existing Blade views.
Blade Directives
To assist with hybrid theme development, Acorn FSE Helper includes a few useful Blade directives out of the box for working with blocks inside of views.
@blocks
The @blocks directive allows you to render raw block markup inside of a view using do_blocks():
@blocks
<!-- wp:paragraph {"align":"center"} -->
<p>Lorem ipsum...</p>
<!-- /wp:paragraph -->
@endblocks
@blockpart
The @blockpart directive provides a convenient way to render block template parts inside of your views using block_template_part():
@blockpart('header')
To render multiple template parts at once, you may pass an array in the order you wish them to be rendered in:
@blockpart(['header', 'footer'])
Vite Asset Integration
Acorn FSE Helper can automatically inject Vite assets (CSS and JavaScript) into the <head> of your FSE theme.
To enable this feature:
-
Publish the configuration file:
$ wp acorn vendor:publish --tag=fse-config
-
Enable Vite asset injection in
config/fse.php:'vite_enabled' => true,
By default, it includes:
resources/css/app.cssresources/js/app.js
You can customize the entry points using the acorn/fse/vite_entrypoints filter:
add_filter('acorn/fse/vite_entrypoints', function ($entryPoints) { return [ 'resources/css/app.css', 'resources/css/editor.css', 'resources/js/app.js', 'resources/js/custom.js', ]; });
Community
Keep track of development and community news.
- Join us on Discord by sponsoring us on GitHub
- Join us on Roots Discourse
- Follow @rootswp on Twitter
- Follow the Roots Blog
- Subscribe to the Roots Newsletter
roots/acorn-fse-helper 适用场景与选型建议
roots/acorn-fse-helper 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 31.34k 次下载、GitHub Stars 达 19, 最近一次更新时间为 2024 年 03 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 roots/acorn-fse-helper 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 roots/acorn-fse-helper 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 31.34k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 19
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-03-28