[T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

35
TYPO3 Phoenix Content model and TypoScript Tuesday 26 June 12

Transcript of [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

Page 1: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

TYPO3 Phoenix Content model and

TypoScript

Tuesday 26 June 12

Page 2: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

Christian Müller

twitter: [email protected]

TYPO3 Freelancer

TYPO3 Phoenix and FLOW3 Core Team Member

Book and Music Freak

Tuesday 26 June 12

Page 3: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

Phoenix?

• Next generation Content Management System from the TYPO3 community

• build on top of FLOW3 as framework

• Content Repository approach

• Aloha editor

• alpha, estimated arrival later this year

Tuesday 26 June 12

Page 4: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

Content Model

Tuesday 26 June 12

Page 5: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

Nodes

Tuesday 26 June 12

Page 6: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

are

• hierarchical structure

• actual content is schema less

• representing pages, content elements or anything else you want to include in the tree

Tuesday 26 June 12

Page 7: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

can besite root

page

content section

content element

representation of domain models

and just anything you want them to be!

Tuesday 26 June 12

Page 8: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

can besite root

page

content section

content element

representation of domain models

and just anything you want them to be!

Tuesday 26 June 12

Page 9: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

are addressed by nodePaths

/sites/typo3org/home/subpage/main/text1

Tuesday 26 June 12

Page 10: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

are addressed by nodePaths

/sites/typo3org/home/subpage/main/text1

site root

Tuesday 26 June 12

Page 11: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

are addressed by nodePaths

/sites/typo3org/home/subpage/main/text1

site root

pages

Tuesday 26 June 12

Page 12: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

are addressed by nodePaths

/sites/typo3org/home/subpage/main/text1

site root

pages

section

Tuesday 26 June 12

Page 13: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

are addressed by nodePaths

/sites/typo3org/home/subpage/main/text1

site root

pages

section

content

Tuesday 26 June 12

Page 14: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

Context

Tuesday 26 June 12

Page 15: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

is

• an environment a node exists in

• for example a workspace

Tuesday 26 June 12

Page 16: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

therefor

• same node can exist in multiple contexts

Tuesday 26 June 12

Page 17: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

typo3.org

homepage section:main

section:side

section:side

en_EN

en_ENen_EN

de_DE

maincontenten_EN

sidecontenten_EN

sidecontentde_DE

Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet

Tuesday 26 June 12

Page 18: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

typo3.org

homepage section:mainen_ENen_EN

maincontenten_EN

typo3.org

homepage section:mainen_ENen_EN

maincontenten_EN

Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet

“live” workspace

“user-christian” workspace

Tuesday 26 June 12

Page 19: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

typo3.org

homepage section:mainen_ENen_EN

maincontenten_EN

typo3.org

homepage section:mainen_ENen_EN

maincontenten_EN

Lorem ipsum dolor sit amet

Some real content text here

“live” workspace

“user-christian” workspace

Tuesday 26 June 12

Page 20: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

'TYPO3.TYPO3:Text': superTypes: ['TYPO3.TYPO3:ContentObject'] group: 'General' icon: 'Images/Icons/White/text.png' label: 'Text'

properties: headline: label: string default: 'Enter headline here' text: label: string default: '<p>Enter text here</p>'

inlineEditableProperties: ['headline', 'text']

content configuration

Tuesday 26 June 12

Page 21: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

TypoScript 2

• Convention over Configuration

• no TypoScript in database

• Sub directories as in Node Hierarchy to add extension templates

Tuesday 26 June 12

Page 22: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

What do we want to do with TypoScript?

Tuesday 26 June 12

Page 23: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

render containers output properties

render nodes

rend

er g

roup

s of n

odes

select nodes

wrap contentconfigure output

filter nodes

exte

nd it

rend

er m

enus

Tuesday 26 June 12

Page 24: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

Boils down to

• mainly dealing with nodes

• but not always involving a node

• nodes can be rendered multiple times

• flexibility needed

• hierarchical access to nodes

Tuesday 26 June 12

Page 25: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

• TypoScript v4: extensibility, stdWrap

• Fluid: HTML Templating

• JavaScript: Prototype-based inheritance

• jQuery: selecting nodes, fluent interface

• CSS: set-based API; Selector Syntax

• XPath: Traversal Operations

Inspirations

Tuesday 26 June 12

Page 26: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

Out-Of-Band Rendering

• Rendering single content elements

• needs: side-effect-free language

• needs: compact addressing

• Node Path: /sites/flow3org/home[TYPO3.TYPO3:Page]

• TypoScript Path: page/body

Tuesday 26 June 12

Page 27: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

Pagepage = TYPO3.TYPO3:Pagepage.body.templatePath = 'resource://My.Site/Private/ ↵Templates/Page/Default.html'page.body.sectionName = 'body'

TypoScript 2

page = PAGEpage.10 = TEMPLATEpage.10.template = FILEpage.10.template.file = fileadmin/templates/default.htmlpage.10.workOnSubpart = bodypage.10.marks …

TypoScript

Tuesday 26 June 12

Page 28: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

Content

page.body.sections.main = TYPO3.TYPO3:Sectionpage.body.sections.main.nodePath = 'main'

TypoScript 2

page.10.marks.maincontent = CONTENTpage.10.marks.maincontent.table = tt_contentpage.10.marks.maincontent.select.where = colPos = 0

(page.10.marks.maincontent < styles.content.get)

TypoScript

Tuesday 26 June 12

Page 29: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

Menu

page.body.parts { menu = TYPO3.TYPO3:MenuRenderer}

TypoScript 2

page.10.marks.menu = HMENUpage.10.marks.menu {1 = TMENU1.wrap = <ul class=”nav”>|</div>1.NO.wrapItemAndSub = <li>|</li>1.CUR = 11.CUR.wrapItemAndSub = <li class=”current”>|</li>

}

TypoScript

Tuesday 26 June 12

Page 30: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

FlowQuery

Tuesday 26 June 12

Page 31: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

FlowQuery

• Selector syntax like jQuery for TYPO3

• working with a context (usually a node)

${context.property('text')}

Tuesday 26 June 12

Page 32: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

Traversal

// return first node in subnode with path

// ‘left’

${context.children('left').first()}

${context.children().filter('left').first()}

// return collection of all parents (rootline)

${context.parents()}

Tuesday 26 June 12

Page 33: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

Processors

Tuesday 26 June 12

Page 34: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

are

• replacing stdWrap

• usable everywhere

• easy to create by yourself

prototype(TYPO3.TYPO3:Text).headline << 1.wrap(prefix: '-', suffix: '-')

Tuesday 26 June 12

Page 35: [T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

Thank you!Questions?

twitter: @daskitsunetemail: [email protected]

Tuesday 26 June 12