The document discusses content modeling in Neos using nodes and node types. It provides examples of creating custom node types for things like a person profile, contact address, and teaser content. Node types define the structure and properties of a node. Typoscript is used to render the node types and templates provide the output markup. Custom node label generators can also be defined to control node labels.
3. Inspiring Conference 2014
What’s next
Short introduction to Structured Content
Think about content
Your first custom Node Type
A bit more advanced example
7. Inspiring Conference 2014
What’s a Node ?
A node is a small piece of content
Content is your first class citizen
Can be structured
Nodes can contain other node
8. Inspiring Conference 2014
Entity or Node
A different way to interact with content
In Neos, try to focus on Node
- Inline editing, Workspace, Content Dimension
- FlowQuery & EEL, Import / Export, …
!
Standard Doctrine Entity can be used for specific needs
12. Inspiring Conference 2014
When did you need a
new Document Type
You need an URL to access this content
- Customer
- Project Reference
- People
- Blog post, News, …
13. Inspiring Conference 2014
Do you remember
your first jQuery
plugin ?
That was maybe not « yours »
What about JavaScript internals ?
18. Inspiring Conference 2014
How it’s done ?
A new Node Type based on the default Text Node Type
A small piece of TypoScript
19. Inspiring Conference 2014
Please define
Node Type
A Node Type define the structure of a node
A Node Type can have Super Type (inheritance)
The structure of a node can change
22. Inspiring Conference 2014
A bit more advanced
As a client
I need to display a list of persons on my website
Each person has their own profile
I need to be able to insert person address and a link to
the profile on any page
23. Inspiring Conference 2014
What’s a Person
Your first
Abstract Node Type
'Ttree.InspiringConf:Schema.Person':
abstract: true
ui:
inspector:
groups:
person:
label: 'Person'
position: 1
properties:
personName:
type: string
ui:
label: 'Name'
reloadIfChanged: TRUE
inspector:
group: person
27. Inspiring Conference 2014
You say PrimaryContent ?
Use it only one time in your page
Neos know where to render the main content
Don’t use it for your sidebar
prototype(TYPO3.Neos:PrimaryContent).TtreeInspiringConfPerson {
condition = ${q(node).is('[instanceof Ttree.InspiringConf:Person]')}
type = 'Ttree.InspiringConf:Person'
@position = 'start'
}
28. Inspiring Conference 2014
Let’s preparing the view …
Will be rendered in your PrimaryContent area
!
prototype(Ttree.InspiringConf:Person) < prototype(TYPO3.TypoScript:Template) {
templatePath = 'resource://Ttree.InspiringConf/Private/Templates/NodeTypes/Pers
!
attributes = TYPO3.TypoScript:Attributes {
class = 'person-profile-page'
data-ttree-region = ${node.properties.postalAddressRegion}
data-ttree-country = ${node.properties.postalAddressCountry}
}
!
personName = ${node.properties.personName}
postalAddressStreetAddress = ${node.properties.postalAddressStreetAddress}
postalAddressCountry = ${node.properties.postalAddressCountry}
postalAddressPostalCode = ${node.properties.postalAddressPostalCode}
postalAddressLocality = ${node.properties.postalAddressLocality}
postalAddressRegion = ${node.properties.postalAddressRegion}
!
profile = TYPO3.Neos:ContentCollection {
nodePath = 'profile'
}
}