-
Notifications
You must be signed in to change notification settings - Fork 44
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
[Example] Add selection content-type for custom entity #85
base: example/custom-entity
Are you sure you want to change the base?
[Example] Add selection content-type for custom entity #85
Conversation
92dd780
to
2138884
Compare
2aec0f3
to
6691dbe
Compare
2138884
to
19b7d58
Compare
6691dbe
to
1833f67
Compare
19b7d58
to
9f4a7f0
Compare
1833f67
to
85d3e59
Compare
9f4a7f0
to
4653f9f
Compare
85d3e59
to
08303ca
Compare
list_key: 'events' | ||
display_properties: | ||
- 'name' | ||
icon: 'su-calendar' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Available icons are documented in the Sulu Javascript Docs.
4653f9f
to
cd4fe57
Compare
08303ca
to
b0f648b
Compare
cd4fe57
to
3a052f7
Compare
b0f648b
to
e799f6d
Compare
3a052f7
to
3ccf457
Compare
e799f6d
to
ec0e009
Compare
3ccf457
to
737467e
Compare
ec0e009
to
b82d5f1
Compare
737467e
to
2f49214
Compare
b82d5f1
to
fb2f9c3
Compare
App\Content\Type\SingleEventSelection: | ||
tags: [ { name: 'sulu.content.type', alias: 'single_event_selection' } ] | ||
|
||
App\Content\Type\EventSelection: | ||
tags: [ { name: 'sulu.content.type', alias: 'event_selection' } ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a field-type is used inside of a page template, Sulu looks for a content-type that matches the name of the field-type. A content-type is registered as Symfony service and is responsible for loading and storing the data of the field to the page.
If a field-type is not used inside of page templates, it is not necessary to implement a matching content-type.
2f49214
to
c992698
Compare
fb2f9c3
to
a93855f
Compare
d052269
to
7265b30
Compare
a93855f
to
98a4703
Compare
7265b30
to
69b1e17
Compare
98a4703
to
7016f60
Compare
7016f60
to
c6aa14d
Compare
69b1e17
to
46a3a42
Compare
c6aa14d
to
b79ad69
Compare
46a3a42
to
66a3d03
Compare
b79ad69
to
7f1b513
Compare
66a3d03
to
18cd7be
Compare
7f1b513
to
a051e72
Compare
a051e72
to
b1bb926
Compare
types: | ||
list_overlay: | ||
adapter: 'table' | ||
list_key: 'events' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reference the already existing events.xml
: here: https://github.com/sulu/sulu-demo/blob/example/custom-entity/config/lists/events.xml
What's in this PR?
This PR demonstrates how to add a
selection
andsingle_selection
content-type for a custom entity. The content-types allow to select one or multiple entities inside of a page template or a form. This PR builds upon #84.Have a look at the Extend Admin UI documentation for more information about the changes in this PR.
To use the content-types, you need to add a property with the respective type to a page template or a form: