|
1 | | -# NEOS error pages |
2 | | -[]() |
3 | | -[]() |
4 | | -[]() |
| 1 | +# Neos error pages |
5 | 2 |
|
6 | | -This package provides multible error pages for your NEOS CMS site. |
7 | | -You can have a error page for each sub folder, this package shows the nearest error page. |
| 3 | +[](https://packagist.org/packages/breadlesscode/neos-error-pages) |
| 4 | +[](https://packagist.org/packages/breadlesscode/neos-error-pages) |
| 5 | +[](LICENSE) |
| 6 | +[](https://github.com/breadlesscode/neos-error-pages/stargazers) |
| 7 | +[](https://github.com/breadlesscode/neos-error-pages/subscription) |
| 8 | + |
| 9 | +This package provides multiple error pages for your Neos CMS site. |
| 10 | +You can add an error page for each subfolder; this package shows the nearest |
| 11 | +error page from the entry point. |
8 | 12 |
|
9 | 13 | ## Installation |
10 | | -Install this package in your NEOS project root. |
11 | 14 |
|
| 15 | +Most of the time you have to make small adjustments to a package (e.g., the |
| 16 | +configuration in `Settings.yaml`). Because of that, it is important to add the |
| 17 | +corresponding package to the composer from your theme package. Mostly this is the |
| 18 | +site package located under `Packages/Sites/`. To install it correctly go to your |
| 19 | +theme package (e.g.`Packages/Sites/Foo.Bar`) and run following command: |
| 20 | + |
| 21 | +```bash |
| 22 | +composer require breadlesscode/neos-error-pages --no-update |
12 | 23 | ``` |
13 | | -composer require breadlesscode/neos-error-pages |
14 | | -``` |
15 | | -Nearly zero configuration! |
| 24 | + |
| 25 | +The `--no-update` command prevent the automatic update of the dependencies. |
| 26 | +After the package was added to your theme `composer.json`, go back to the root |
| 27 | +of the Neos installation and run `composer update`. Your desired package is now |
| 28 | +installed correctly. |
16 | 29 |
|
17 | 30 | ## Usage |
18 | 31 |
|
19 | | -1. Create your error page in your dimension. |
20 | | -2. Select the correct status codes in the NEOS inspector. |
21 | | -3. Publish |
| 32 | +1. Configure the node type |
| 33 | +2. Configure the fusion prototype |
| 34 | +3. Add one error page to your site root |
22 | 35 |
|
23 | | -## Todo |
24 | | -- [ ] Write some tests (as always...) |
| 36 | +### `Breadlesscode.ErrorPages:Page` |
| 37 | + |
| 38 | +The node type `Breadlesscode.ErrorPages:Page`does inherit from `Neos.Neos:Document`. |
| 39 | +There are no child nodes defined, so if you want to add content elements to your |
| 40 | +error page, you have to add a ContentCollection to the node type. |
| 41 | + |
| 42 | +``` |
| 43 | +'Breadlesscode.ErrorPages:Page': |
| 44 | + childNodes: |
| 45 | + main: |
| 46 | + type: 'Neos.Neos:ContentCollection' |
| 47 | +``` |
| 48 | + |
| 49 | +To overwrite the document with your custom document you can do it like this: |
| 50 | + |
| 51 | +```fusion |
| 52 | +prototype(Breadlesscode.ErrorPages:Page) > |
| 53 | +prototype(Breadlesscode.ErrorPages:Page) < prototype(Vendor.Foo:Page.Document) |
| 54 | +``` |
| 55 | + |
| 56 | +### Fusion path |
| 57 | + |
| 58 | +`errorPages` is the fusion path which gets rendered if an error page gets shown. |
| 59 | +Make sure it has the same look as when you go directly to the page. |
25 | 60 |
|
26 | 61 | ## License |
27 | | -The MIT License (MIT). Please see [License File](LICENSE) for more information. |
| 62 | + |
| 63 | +The MIT License (MIT). Please see [License File](LICENSE) for more information. |
| 64 | + |
| 65 | +## Contributors |
| 66 | + - [Breadlesscode](https://github.com/breadlesscode) |
| 67 | + - [Jonnitto](https://github.com/jonnitto) |
0 commit comments