[T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

1,490 views

Published on

Published in: Technology, Design
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,490
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

[T3CON12CA] Content Model and TypoScript in TYPO3 Phoenix

  1. 1. TYPO3 Phoenix Content model and TypoScriptTuesday 26 June 12
  2. 2. Christian Müller TYPO3 Freelancer TYPO3 Phoenix and FLOW3 Core Team Member Book and Music Freak twitter: daskitsunet christian.mueller@typo3.orgTuesday 26 June 12
  3. 3. 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 yearTuesday 26 June 12
  4. 4. Content ModelTuesday 26 June 12
  5. 5. NodesTuesday 26 June 12
  6. 6. are • hierarchical structure • actual content is schema less • representing pages, content elements or anything else you want to include in the treeTuesday 26 June 12
  7. 7. can be site root page content section content element representation of domain modelsTuesday 26 June 12
  8. 8. can be site root page and just anything content section you want them to be! content element representation of domain modelsTuesday 26 June 12
  9. 9. are addressed by nodePaths /sites/typo3org/home/subpage/main/text1Tuesday 26 June 12
  10. 10. are addressed by nodePaths /sites/typo3org/home/subpage/main/text1 site rootTuesday 26 June 12
  11. 11. are addressed by nodePaths /sites/typo3org/home/subpage/main/text1 site root pagesTuesday 26 June 12
  12. 12. are addressed by nodePaths /sites/typo3org/home/subpage/main/text1 site root section pagesTuesday 26 June 12
  13. 13. are addressed by nodePaths /sites/typo3org/home/subpage/main/text1 site root section pages contentTuesday 26 June 12
  14. 14. ContextTuesday 26 June 12
  15. 15. is • an environment a node exists in • for example a workspaceTuesday 26 June 12
  16. 16. therefor • same node can exist in multiple contextsTuesday 26 June 12
  17. 17. typo3.org en_EN en_EN en_EN homepage section:main maincontent Lorem ipsum dolor sit amet en_EN en_EN section:side sidecontent Lorem ipsum dolor sit amet de_DE de_DE section:side sidecontent Lorem ipsum dolor sit ametTuesday 26 June 12
  18. 18. typo3.org en_EN en_EN en_EN homepage section:main maincontent Lorem ipsum dolor sit amet “live” workspace typo3.org en_EN en_EN en_EN homepage section:main maincontent Lorem ipsum dolor sit amet “user-christian” workspaceTuesday 26 June 12
  19. 19. typo3.org en_EN en_EN en_EN homepage section:main maincontent Lorem ipsum dolor sit amet “live” workspace typo3.org en_EN en_EN en_EN homepage section:main maincontent Some real content text here “user-christian” workspaceTuesday 26 June 12
  20. 20. content configuration 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]Tuesday 26 June 12
  21. 21. TypoScript 2 • Convention over Configuration • no TypoScript in database • Sub directories as in Node Hierarchy to add extension templatesTuesday 26 June 12
  22. 22. What do we want to do with TypoScript?Tuesday 26 June 12
  23. 23. containers ou rende r tput pro re pe rti t nde es wr nd i ap r es exte nod od c on n con te es of figu nt re o s up utput s es ro nu tn od g me lec r se de filter nodes r de n re nTuesday 26 June 12 re
  24. 24. Boils down to • mainly dealing with nodes • but not always involving a node • nodes can be rendered multiple times • flexibility needed • hierarchical access to nodesTuesday 26 June 12
  25. 25. Inspirations • TypoScript v4: extensibility, stdWrap • Fluid: HTML Templating • JavaScript: Prototype-based inheritance • jQuery: selecting nodes, fluent interface • CSS: set-based API; Selector Syntax • XPath: Traversal OperationsTuesday 26 June 12
  26. 26. 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/bodyTuesday 26 June 12
  27. 27. Page TypoScript 2 page = TYPO3.TYPO3:Page page.body.templatePath = resource://My.Site/Private/ ↵ Templates/Page/Default.html page.body.sectionName = body TypoScript page = PAGE page.10 = TEMPLATE page.10.template = FILE page.10.template.file = fileadmin/templates/default.html page.10.workOnSubpart = body page.10.marks …Tuesday 26 June 12
  28. 28. Content TypoScript 2 page.body.sections.main = TYPO3.TYPO3:Section page.body.sections.main.nodePath = main TypoScript page.10.marks.maincontent = CONTENT page.10.marks.maincontent.table = tt_content page.10.marks.maincontent.select.where = colPos = 0 (page.10.marks.maincontent < styles.content.get)Tuesday 26 June 12
  29. 29. Menu TypoScript 2 page.body.parts { menu = TYPO3.TYPO3:MenuRenderer } TypoScript page.10.marks.menu = HMENU page.10.marks.menu { 1 = TMENU 1.wrap = <ul class=”nav”>|</div> 1.NO.wrapItemAndSub = <li>|</li> 1.CUR = 1 1.CUR.wrapItemAndSub = <li class=”current”>|</li> }Tuesday 26 June 12
  30. 30. FlowQueryTuesday 26 June 12
  31. 31. FlowQuery • Selector syntax like jQuery for TYPO3 • working with a context (usually a node) ${context.property(text)}Tuesday 26 June 12
  32. 32. 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
  33. 33. ProcessorsTuesday 26 June 12
  34. 34. are • replacing stdWrap • usable everywhere • easy to create by yourself prototype(TYPO3.TYPO3:Text).headline << 1.wrap(prefix: -, suffix: -)Tuesday 26 June 12
  35. 35. Thank you! Questions? twitter: @daskitsunet email: christian.mueller@typo3.orgTuesday 26 June 12

×