Skip to content
This repository has been archived by the owner on Aug 28, 2020. It is now read-only.

Commit

Permalink
updated readme for better usage description
Browse files Browse the repository at this point in the history
  • Loading branch information
Marvin Kuhn committed Jan 16, 2018
1 parent 349afc1 commit a56bff4
Showing 1 changed file with 56 additions and 16 deletions.
72 changes: 56 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,67 @@
# NEOS error pages
[![Latest Stable Version](https://poser.pugx.org/breadlesscode/neos-error-pages/v/stable)]()
[![Downloads](https://img.shields.io/packagist/dt/breadlesscode/neos-error-pages.svg)]()
[![license](https://img.shields.io/github/license/breadlesscode/neos-error-pages.svg)]()
# Neos error pages

This package provides multible error pages for your NEOS CMS site.
You can have a error page for each sub folder, this package shows the nearest error page.
[![Latest Stable Version](https://poser.pugx.org/breadlesscode/neos-error-pages/v/stable)](https://packagist.org/packages/breadlesscode/neos-error-pages)
[![Downloads](https://img.shields.io/packagist/dt/breadlesscode/neos-error-pages.svg)](https://packagist.org/packages/breadlesscode/neos-error-pages)
[![License](https://img.shields.io/github/license/breadlesscode/neos-error-pages.svg)](LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/breadlesscode/neos-error-pages.svg?style=social&label=Stars)](https://github.com/breadlesscode/neos-error-pages/stargazers)
[![GitHub watchers](https://img.shields.io/github/watchers/breadlesscode/neos-error-pages.svg?style=social&label=Watch)](https://github.com/breadlesscode/neos-error-pages/subscription)

This package provides multiple error pages for your Neos CMS site.
You can add an error page for each subfolder; this package shows the nearest
error page from the entry point.

## Installation
Install this package in your NEOS project root.

Most of the time you have to make small adjustments to a package (e.g., the
configuration in `Settings.yaml`). Because of that, it is important to add the
corresponding package to the composer from your theme package. Mostly this is the
site package located under `Packages/Sites/`. To install it correctly go to your
theme package (e.g.`Packages/Sites/Foo.Bar`) and run following command:

```bash
composer require breadlesscode/neos-error-pages --no-update
```
composer require breadlesscode/neos-error-pages
```
Nearly zero configuration!

The `--no-update` command prevent the automatic update of the dependencies.
After the package was added to your theme `composer.json`, go back to the root
of the Neos installation and run `composer update`. Your desired package is now
installed correctly.

## Usage

1. Create your error page in your dimension.
2. Select the correct status codes in the NEOS inspector.
3. Publish
1. Configure the node type
2. Configure the fusion prototype
3. Add one error page to your site root

## Todo
- [ ] Write some tests (as always...)
### `Breadlesscode.ErrorPages:Page`

The node type `Breadlesscode.ErrorPages:Page`does inherit from `Neos.Neos:Document`.
There are no child nodes defined, so if you want to add content elements to your
error page, you have to add a ContentCollection to the node type.

```
'Breadlesscode.ErrorPages:Page':
childNodes:
main:
type: 'Neos.Neos:ContentCollection'
```

To overwrite the document with your custom document you can do it like this:

```fusion
prototype(Breadlesscode.ErrorPages:Page) >
prototype(Breadlesscode.ErrorPages:Page) < prototype(Vendor.Foo:Page.Document)
```

### Fusion path

`errorPages` is the fusion path which gets rendered if an error page gets shown.
Make sure it has the same look as when you go directly to the page.

## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.

The MIT License (MIT). Please see [License File](LICENSE) for more information.

## Contributors
- [Breadlesscode](https://github.com/breadlesscode)
- [Jonnitto](https://github.com/jonnitto)

0 comments on commit a56bff4

Please sign in to comment.