Sage Child/Parent Theme Support
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 28/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- php
调研方向
Start with the linked parent/child theme discussion, then review the setup points named in helpers.php, composer.php, resources/views/, style.css, View Composers, and Roots config(). Clarify whether the goal is implementation support or a setup guide, and define done as documented or working parent inheritance for views, composers, helpers, and configuration.
由索引模型根据 Issue 内容生成。
描述
- I've read the guidelines for Contributing to Roots Projects
- This request isn't a duplicate of an existing issue
- I've read the docs and followed them (if applicable)
- This is not a personal support request that should be posted on the Roots Discourse community
Description
Related to this discussion: https://discourse.roots.io/t/sage-10-as-parent-child-themes/
It would be fantastic to get some feedback ftom @Log1x and @QWp6t
Steps to reproduce
1. Parent Theme:
1.1 Make a new Sage 10 Theme with custom Namespace "Parent" in folder 'parent'
1.2 Add some View Composers variables such as "siteName" and reference it in a blade file
1.3 Add a function my_test_function() to helpers.php
1.4 Activate the theme, it should be working and the variable $siteName is outputted correctly
2. Child Theme
1.1 Make a new Sage 10 Theme and leave the Namespace as "App" in folder child
1.2 Add Template: parent to style.css
1.3 Remove all blade files from ./resources/views/
1.4 Use \Parent\my_test_function() e.g. in a child View Composer
1.5 Autoload parent theme Class in composer.php:
"psr-4": {
"App\\": "app/",
"Parent\\": "./../parent/app/"
}
1.5 Activate the child theme
Expected behavior: [What you expect to happen]
- Blade views are loaded from parent theme
- View Composers are loaded from parent theme as well as from child theme (ideally overwriting parent values)
- Functions from parent theme in helpers.php are available via
\Parent\my_test_function() - Config via
\Roots\config()is loading parent theme value, if child theme value is not set
Actual behavior: [What actually happens]
- Blade views are loaded from parent theme
-
Undefined variable: siteNameerrors, the View Composers from the parent theme are missing - Call to undefined function errors when calling
\Parent\my_test_function() - Error if e.g.
\Roots\config('app.debug')is not set in child theme as function not checks against parent value
Reproduces how often: [What percentage of the time does it reproduce?]
In the current setup 100%. More tests required.
Versions
Sage 10.0.0-alpha
Additional information
It would be fantastic to get a very short summary how child/parent themes should be set-up with Sage 10.
- 主要语言
- 没有语言数据
- 星标
- 171
- 派生
- 181
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
roots/docs 的其他 Issue
相似的 Issue
-
sync-en
难度 1/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
[oblt-aw][autodoc] Update docs for security org scaffolding and Docs AI menu permission changes可能已有人在做 @github-actions 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
manuscript-lang/manuscript#1627 ·
维护者通常 1 天内回复
-
external integration integration-submission
难度 2/5 1-3 小时 新手友好度 68/100
langchain-ai/docs#7077 ·
维护者通常 1 天内回复
-
enhancement p2 setup
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复