neos-development-collection icon indicating copy to clipboard operation
neos-development-collection copied to clipboard

FEATURE: Custom label for auto created child nodes

Open dfeyer opened this issue 9 years ago • 17 comments

This change add a node type configuration to generate a custom node label for auto created child nodes:

'Neos.Neos.NodeTypes:Page':
  superTypes:
    'Neos.Neos:Document': TRUE
  childNodes:
    main:
      label: 'Main Content Collection'
      type: 'Neos.Neos:ContentCollection'

This allow to have a less technical content tree. This change include the schema validation and default label for default node types.

The label can be a string or an EEL expression. Inside the expression you can access the parent node in the variable parentNode.

dfeyer avatar May 19 '16 14:05 dfeyer

By analyzing the blame information on this pull request, we identified @radmiraal, @skurfuerst and @aertmann to be potential reviewers

mention-bot avatar May 19 '16 14:05 mention-bot

Pretty useful for ContentCollection to replace "Content Collection (footer)", by something more human readable like "Document Footer". Also useful with complex node type with multiple child node, like a Staff, with multiple PostalAddress and ContactInformation, ...)

dfeyer avatar May 19 '16 14:05 dfeyer

See inline comment 👎 for now

kitsunet avatar May 20 '16 00:05 kitsunet

Nice idea, I think we can make it work.. see inline comments

It's missing documentation as well though

aertmann avatar May 20 '16 05:05 aertmann

@aertmann @kitsunet Now support string, and no dependency to the ContentCollection anymore, it's pretty generic and useful.

As discussed with @kitsunet last week, we need to take to not have too much configuration that can depend on the "context" (parent node, ...) or we will have hard time to debug it.

Next step a small documentation and this one is merge ready

dfeyer avatar Jul 11 '16 22:07 dfeyer

Up to date with master and update the first PR comment to show the possibility to use a string or EEL expression as label.

dfeyer avatar Nov 03 '16 19:11 dfeyer

👍 Shoudl be fine!

kitsunet avatar Nov 10 '16 09:11 kitsunet

@aertmann If you can review again we can merge this one

dfeyer avatar Nov 10 '16 14:11 dfeyer

@aertmann @kitsunet Maybe this can finaly be merged ;)

dfeyer avatar Dec 05 '17 12:12 dfeyer

Thanks @aertmann for the review, all comments fixed

dfeyer avatar Dec 05 '17 18:12 dfeyer

I re-read the code and from a user perspective this is great, but I am still not convinced about the implementation. That's a lot of logic in the LabelGenerator that any person implementing the interface would have to replicate. Also The LabelGenerator shouldn't be in charge of figuring this out. If we want to do this, we might want to change the interface to tell the generator where to get the config from maybe.

kitsunet avatar Dec 10 '17 10:12 kitsunet

@kitsunet What if we introduce an Abstract class with helper function, and a protected method to override the label for the automaticaly created child nodes ? Like this custom implementation can reuse the abstract class and we avoid changing the interface ?

dfeyer avatar May 08 '18 20:05 dfeyer

And maybe a missing feature is the support of i18n keywords to have translatable labels ...

dfeyer avatar May 08 '18 20:05 dfeyer

This looks really useful, so could you (@dfeyer and @kitsunet) decide on a path forward? Thanks!

kdambekalns avatar Jun 25 '18 07:06 kdambekalns

I added an issue for this: #2276

PS: Not directly related but I'm convinced that we should move away from using EEL directly in YAML as it's really error prone

bwaidelich avatar Nov 15 '18 12:11 bwaidelich

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions!

stale[bot] avatar May 30 '19 01:05 stale[bot]

This issue has been automatically closed because it has not had activity for some time. But that does not need to be final. If you find the time to work on it, feel free to open it again. Thanks again for your contributions!

stale[bot] avatar Jun 13 '19 02:06 stale[bot]