[SOLVED] Overwrite Default NodeType Definition ui-area

Hey,
I would like to extend default NodeTypes like «Neos.NodeTypes:Headline» and define a new label for. Like «Headline +» to recognize in BE with ease the changed nodeTypes/Possibilities.

Strangely, all extending-stuff for properties and supertypes works fine. But Neos ignore the «ui» part.
Maybe I have to empty them first like in fusion? But all the «[]» or «~» tries create no changes. Have cleaned all cache + Configuration/PackagesStates.php + did a rescan.

  • How I can change the default value for ui.label and ui.icon?

What i usually do is extend the base nodeTypes if i need to:

# make the default nodeType abstract so it cannot be used directly
'Neos.NodeTypes:Headline'
  abstract: true

# define custom nodetype
'Vendor.Site:Headline'
  superTypes:
    'Neos.NodeTypes:Headline' : true
  ...

Will be arguable more future-proofed :wink: and less confusing too:
thanks @mficzel.

I use this because if i will ever stumble upon a nodeType Vendor.Site:Headline i will instantly know that this is no default type and will look at the rendering and the properties. I i will have issues with Neos.NodeTypes:Headline this may not be the first thing i check.

So for me this a reminder for the future me who has to debug this someday.

By the way -> debug – Sorry: :pensive:
I got an error-throwing, when I set Neos.NodeTypes:Headline to abstract: true

The Fusion object at path `landingPage<Neos.Neos:Page>/body<Neos.Fusion:Template>/content/main<Neos.Neos:PrimaryContent>/default<Neos.Fusion:Matcher>/renderer<Neos.Neos:ContentCollection>/content<Neos.Neos:ContentCollectionRenderer>/itemRenderer<Neos.Neos:ContentCase>/default<Neos.Fusion:Matcher>/element<Neos.NodeTypes:Headline>` could not be rendered: The Fusion object `Neos.NodeTypes:Headline` is not completely defined (missing property `@class`). Most likely you didn't inherit from a basic object. For example you could add the following line to your Fusion: `prototype(Neos.NodeTypes:Headline) < prototype(Neos.Fusion:Template)`
landingPage<Neos.Neos:Page>/
 body<Neos.Fusion:Template>/
  content/
   main<Neos.Neos:PrimaryContent>/
    default<Neos.Fusion:Matcher>/
     renderer<Neos.Neos:ContentCollection>/
      content<Neos.Neos:ContentCollectionRenderer>/
       itemRenderer<Neos.Neos:ContentCase>/
        default<Neos.Fusion:Matcher><Neos.Fusion:Matcher>/
For a full stacktrace, open Data/Logs/Exceptions/201704251023094230a6.txt


```
# File 20170425103041c06328.txt means:

```
Exception #1332493995 in line 393 of /Users/mh/Sites/MAMP-htdocs/demo-3-clean.neos/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Fusion_Core_Runtime.php: The Fusion object at path `landingPage<Neos.Neos:Page>/body<Neos.Fusion:Template>/content/main<Neos.Neos:PrimaryContent>/default<Neos.Fusion:Matcher>/renderer<Neos.Neos:ContentCollection>/content<Neos.Neos:ContentCollectionRenderer>/itemRenderer<Neos.Neos:ContentCase>/default<Neos.Fusion:Matcher>/element<Neos.NodeTypes:Headline>` could not be rendered:
					The Fusion object `Neos.NodeTypes:Headline` is not completely defined (missing property `@class`).
					Most likely you didn't inherit from a basic object.
					For example you could add the following line to your Fusion:
					`prototype(Neos.NodeTypes:Headline) < prototype(Neos.Fusion:Template)`

69 Neos\Fusion\Core\Runtime_Original::throwExceptionForUnrenderablePathIfNeeded("landingPage<Neos.Neos:Page>/body<Neos.Fusion:Templ…s.Fusion:Matcher>/element<Neos.NodeTypes:Headline>", array|1|, "Exception")
68 Neos\Fusion\Core\Runtime_Original::evaluateInternal("landingPage<Neos.Neos:Page>/body<Neos.Fusion:Templ…s.Fusion:Matcher>/element<Neos.NodeTypes:Headline>", "Exception")
67 Neos\Fusion\Core\Runtime_Original::render("landingPage<Neos.Neos:Page>/body<Neos.Fusion:Templ…s.Fusion:Matcher>/element<Neos.NodeTypes:Headline>")
66 Neos\Fusion\FusionObjects\RendererImplementation_Original::evaluate()
```
When I comment-out the lines in my NodeTypes.Override.yaml

    #Disable Default-Headline and provide instead HeadlinePlus
    #'Neos.NodeTypes:Headline':
    #  abstract: true
-> Error-Throwing is gone. I thought it will have to do with some of my own written Plugins (maybe). So I tried also in a clean neos.demo v3 and also in a clean-dem v2.3 > same behavior and error. 

I also set Neos.NodeTypes:Text to abstract. There is no-time problem with. Don't understand the problem. When I prototype from Template like advised in Exception, then the next step is following with an other throwing ...
**Hope for you or someone else, is simple and the point obvious and easy to solve with an advice?** 
I'm stuck with...

Probably a bad idea to set a NodeType to «abstract» when already Nodes are created from this type. Could be, this setting is responsible not only new creating elements, but also already created ones … And then those will cry, because those are obvious more than from abstract-nature.

Did a search-replace in Database for old Neos.NodeType:Text/Headline and replace it with new one, extended from the default nodeTypes.
For sure the lumberjack method, but it works -> No errors left.
@mficzel: I’m on the right track?


####What does not fit with the idea[quote=“martoro, post:4, topic:2173”]
stumble upon a nodeType Vendor.Site:Headline i will instantly know that this is no default type
[/quote]
Maybe it’s something with conjunction to Demo.Site. But at the end I can use new ones without confusing multiple choice for each type and without Error-Throwing. On other (new) Projects, there will be no default Neos.NodeType:Text and Headlines in DB. So no Error from beginning.

Would be a better solution if I could also use in past projects, but maybe this is the borderline …

Yes … if you do this you will have to adjust the nodes that are already in the database. Since this is a 1:1 transformation it is quite easy. I even (ab)use db-migrations for that sometimes but you can also do it direct or use a cr-migration.

BTW: The only intended effect of setting the node abstract is that it cannot be created anymore. You can also achieve this otherwise if you want.

In all bigger projects i do not use the default-nodetypes directly but always create a derived type in the project namespace. Together with some constraints i do’nt have to set the default types to abstract.

Thank you for finalizing explanation @mficzel.