Skip to content

Commit e7e8662

Browse files
author
Marvin Kuhn
committed
added readme with some basic informations
1 parent a8b753e commit e7e8662

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed

README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Neos Listable
2+
[![Latest Stable Version](https://poser.pugx.org/breadlesscode/neos-listable/v/stable)](https://packagist.org/packages/breadlesscode/neos-listable)
3+
[![Downloads](https://img.shields.io/packagist/dt/breadlesscode/neos-listable.svg)](https://packagist.org/packages/breadlesscode/neos-listable)
4+
[![License](https://img.shields.io/github/license/breadlesscode/neos-listable.svg)](LICENSE)
5+
[![GitHub stars](https://img.shields.io/github/stars/breadlesscode/neos-listable.svg?style=social&label=Stars)](https://github.com/breadlesscode/neos-listable/stargazers)
6+
[![GitHub watchers](https://img.shields.io/github/watchers/breadlesscode/neos-listable.svg?style=social&label=Watch)](https://github.com/breadlesscode/neos-listable/subscription)
7+
8+
This Neos CMS plugin is for listing and paginate NodeTypes in Fusion.
9+
This package is heavily inspired by [Flowpack.Listable](https://github.com/Flowpack/Flowpack.Listable), thanks for that :)
10+
11+
## Installation
12+
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:
13+
14+
```bash
15+
composer require breadlesscode/neos-listable --no-update
16+
```
17+
18+
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.
19+
20+
## Example
21+
```
22+
prototype(Vendor.Xy:MyPersonalList) < prototype(Breadlesscode.Listable:List) {
23+
collection = ${ q(site).find('[instanceof Vendor.Xy:BlogPost]') }
24+
itemsPerPage = ${ 10 }
25+
itemRenderer = 'Vendor.Xy:MyPersonalListItem'
26+
itemName = ${ 'item' }
27+
# if you want no pagination you can set this property:
28+
# paginated = ${ false }
29+
}
30+
31+
prototype(Vendor.Xy:MyPersonalListItem) < prototype(Neos.Fusion:Tag) {
32+
tagName = 'a'
33+
content = ${ q(item).property('title') }
34+
attributes {
35+
href = Neos.Neos:NodeUri {
36+
node = ${ item }
37+
}
38+
}
39+
40+
@process.headlineWrap = ${ '<h2>' + value '</h2>' }
41+
}
42+
43+
```
44+
## Configuration
45+
You have to possibilities to configure the pagination of this package. You can set the configurations global via `Settings.yaml`:
46+
47+
```yaml
48+
Breadlesscode:
49+
Listable:
50+
pagination:
51+
showSeperators: true
52+
showNextAndPrevious: true
53+
showFirstAndLast: true
54+
labels:
55+
seperator: '&hellip;'
56+
previous: '&lang;'
57+
next: '&rang;'
58+
first: '&lang;'
59+
last: '&raquo;'
60+
```
61+
62+
And you can overwrite this configuration in Fusion for a specific list:
63+
64+
```
65+
prototype(Vendor.Xy:MyPersonalList) < prototype(Breadlesscode.Listable:List) {
66+
# ...
67+
paginationConfig {
68+
showSeperators = ${ true }
69+
showNextAndPrevious = ${ true }
70+
showFirstAndLast = ${ true }
71+
72+
labels {
73+
seperator = ${ '&hellip' }
74+
previous = ${ '&lang;' }
75+
next = ${ '&rang;' }
76+
first = ${ '&lang;' }
77+
last = ${ '&rang;' }
78+
}
79+
}
80+
}
81+
```
82+
83+
84+
## License
85+
86+
The MIT License (MIT). Please see [License File](LICENSE) for more information.

0 commit comments

Comments
 (0)