Sage Child/Parent Theme Support
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 28/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- php
- Lĩnh vực
- documentation
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
- 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.
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 171
- Fork
- 181
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của roots/docs
-
Queue table command missingĐang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Issue tương tự
-
docs good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Usenova-Labs/usenova-backend#36 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
git: README should state plainly that without --repository every reachable repository is in scopeĐang mởdocumentation server-git v2
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
modelcontextprotocol/servers#5225 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Changelog lists three bar periods for bars of a day or longer but custom timeframes use anotherĐang mởdata documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
userFRM/egui-charts#623 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/vscode-docs#10534 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
Droid-Deck/DroidDeck#1355 ·
Maintainer thường phản hồi trong vòng 1 ngày