Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC Document new startup theme #683

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions en/00_Getting_Started/02_Composer.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ file. It will appear in your project root, and by default, it will look somethin
"silverstripe/recipe-plugin": "~2.0.1@stable",
"silverstripe/vendor-plugin": "~3.0.0@stable",
"silverstripe/recipe-cms": "~6.0.0@stable",
"silverstripe-themes/simple": "~3.2.0@stable",
"silverstripe/startup-theme": "~1.0.0@stable",
"silverstripe/login-forms": "~6.0.0@stable"
},
"require-dev": {
Expand Down Expand Up @@ -343,7 +343,7 @@ Open `composer.json`, and find the module's `require`. Then put `as (core versio
"php": "^8.3",
"silverstripe/recipe-cms": "~6.0.0@stable",
"silverstripe/framework": "dev-myproj as 6.0.0",
"silverstripe-themes/simple": "~3.2.0"
"silverstripe/startup-theme": "~1.0.0"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion en/00_Getting_Started/04_Directory_Structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Silverstripe core modules.

| Directory | Description |
| ------------------ | --------------------------- |
| `themes/simple/` | Standard "simple" theme |
| `themes/startup-theme/` | Default theme |
| `themes/<yourtheme>/` | Custom theme base directory |
| `themes/<yourtheme>/templates` | Theme templates |
| `themes/<yourtheme>/css` | Theme CSS files |
Expand Down
6 changes: 3 additions & 3 deletions en/02_Developer_Guides/01_Templates/03_Requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ use SilverStripe\View\Requirements;
Requirements::javascript('app/client/dist/bundle.js');

// When referencing theme files, use a path relative to the root of your project
Requirements::javascript('themes/simple/javascript/script.js');
Requirements::javascript('themes/my-theme/javascript/script.js');

// When referencing files from a module, you need to prefix the path with the module name.
Requirements::javascript('silverstripe/admin:client/dist/js/bundle.js');
Expand Down Expand Up @@ -446,8 +446,8 @@ If you want to get a resource for a *specific* theme or from somewhere that is n
```ss
<img src="$resourceURL('app/images/my-image.jpg')">
<img src="$resourceURL('my/module:images/my-image.jpg')">
<img src="$resourceURL('themes/simple/images/my-image.jpg')">
<img src="$resourceURL('themes/simple/images')/$Image.jpg">
<img src="$resourceURL('themes/my-theme/images/my-image.jpg')">
<img src="$resourceURL('themes/my-theme/images')/$Image.jpg">
```

> [!TIP]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,10 @@ class MyAdmin extends ModelAdmin
> <head></head>
> <%-- body tag is needed for javascript to be injected --%>
> <body>
> <%-- these two divs are just here to comply with styling from the simple theme, replace them with your own theme markup --%>
> <div class="main"><div class="inner typography line">
> <%-- these HTML elements are just here to comply with styling from the default theme, replace them with your own theme markup --%>
> <main class="container container--page"><div class="page"><div class="page__content>
> $Preview
> </div></div>
> </div></div></main>
> </body>
> </html>
> ```
Expand Down
11 changes: 11 additions & 0 deletions en/08_Changelogs/6.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ title: 6.0.0 (unreleased)
- [Changes to `LeftAndMain` and its subclasses](#leftandmain-refactor)
- [Changes to password validation](#password-validation)
- [Status flags in the CMS](#status-flags-in-the-cms)
- [New default front-end theme](#theme)
- [Other new features](#other-new-features)
- [Dependency changes](#dependency-changes)
- [`intervention/image` has been upgraded from v2 to v3](#intervention-image)
Expand Down Expand Up @@ -801,6 +802,16 @@ Status flags are displayed in breadcrumbs at the top of edit forms in the CMS, i

See [status flags](/developer_guides/customising_the_admin_interface/status_flags/) for more information.

### New default front-end theme {#theme}

New projects created using `silverstripe/installer` will notice a new theme [`silverstripe/startup-theme`](https://packagist.org/packages/silverstripe/startup-theme) which replaces `silverstripe-themes/simple`.

The new theme is visually very similar to the old one, but has been built from the ground up with cascading themes and customisability in mind. For example you can customise a lot of the styling by changing values of CSS variables.

The new theme also outputs the `$ElementalArea` by default if you have [`dnadesign/silverstripe-elemental`](https://packagist.org/packages/dnadesign/silverstripe-elemental) installed, and exposes the [`$SilverStripeNavigator`](/developer_guides/templates/common_variables/#silverstripenavigator) for logged in users.

Most projects will still benefit from a custom built theme, but this new theme should make it easier to test and validate PHP code changes in the early stages of a project and for module development.

### Other new features

- Modules no longer need to have a root level `_config.php` or `_config` directory to be recognised as a Silverstripe CMS module. They will now be recognised as a module if they have a `composer.json` file with a `type` of `silverstripe-vendormodule` or `silverstripe-theme`.
Expand Down
2 changes: 1 addition & 1 deletion en/12_Project_Governance/07_Supported_Modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Supported PHP Module | Supported versions
[colymba/gridfield-bulk-editing-tools](https://packagist.org/packages/colymba/gridfield-bulk-editing-tools) | 5
[dnadesign/silverstripe-elemental](https://packagist.org/packages/dnadesign/silverstripe-elemental) | 6
[dnadesign/silverstripe-elemental-userforms](https://packagist.org/packages/dnadesign/silverstripe-elemental-userforms) | 5
[silverstripe-themes/simple](https://packagist.org/packages/silverstripe-themes/simple) | 3
[silverstripe/startup-theme](https://packagist.org/packages/silverstripe/startup-theme) | 1
[silverstripe/dynamodb](https://packagist.org/packages/silverstripe/dynamodb) | 6
[silverstripe/gridfieldqueuedexport](https://packagist.org/packages/silverstripe/gridfieldqueuedexport) | 4
[silverstripe/hybridsessions](https://packagist.org/packages/silverstripe/hybridsessions) | 4
Expand Down