how we use the abivia content pattern (acp) plugin in joomla website development

Download How We Use the Abivia Content Pattern (ACP) Plugin in Joomla Website Development

If you can't read please download the document

Upload: alan-langford

Post on 15-Aug-2015

1.546 views

Category:

Technology


1 download

TRANSCRIPT

  1. 1. How WeACPUse(the Abivia Content Patternin Websiteplug-in)DevelopmenAlan Langford, www.abivia.net
  2. 2. How We Use ACPWhat problems does ACP solveWhat is a patternWalk through a few examplesQuestions
  3. 3. About Me Active in FOSS since mid-1990s Involved with Joomla since 2006 Founding member of Joomla Security Team Project structure WG Working on Joomla 4.0 architecture Former development team and JBS member Pioneered unit testing in Joomla core Contributor to PHPs PEAR Founded Abivia Web Hosting and Development in 2005
  4. 4. What is ACP?Abivia Content Pattern Plugin A plugin for content that separates dataDatafrom presentation
  5. 5. What is a Pattern?Template Clone to Article User DataFinal Article
  6. 6. Data + Pattern = Page Content Article Final Article Patterns Pattern Reference Resolved Pattern with DataACP (Runs during Pattern Reference Page Composition) Resolved Pattern with Data
  7. 7. Thats Nice But... Why Do I Care?
  8. 8. What Does ACP Fix?Unwanted changes by WYSIWYG Editors Just do it in Dreamweaver then paste it in
  9. 9. What Does ACP Fix?ts ila r formas with simny articlening maMaintai
  10. 10. What Does ACP Fix?Inde cisiv e Clien ts
  11. 11. What Does ACP Fix? I liked it better with a bigger image I know kittens dont really go with the rest of the site but these Unwa ones are sonted cute I thought it p would be okay resenta if we did it just tion changes b this one time y huma dont you think n edi theyre cute my tors partneralso thinks it would be nice to put up a picture of his dog rex and
  12. 12. Advantages of PatternsPattern Applied during page composition Presentation changes have instant effect A pattern is just another articleTemplate One time substitution when article added Presentation elements are baked in Users can make unwanted changes to presentationelements
  13. 13. Why pattern Template is an over used that has too manymeanings: Joomla Templates Content Templater from NoNumber.nl Other content template solutions Stand-alone template systems Template systems built into other extensions
  14. 14. Using Abivia Content PatternsA Brief History of ACP
  15. 15. ACPs Humble BeginningOrdered lists in (older) TinyMCE 1. Item One 2. Item Two 1. Item Three 2. Item Four
  16. 16. ACPs Humble BeginningPlug-in to fix lists:Template body: {template ordered-list}
    1. {list Item One} {for item} {list Item Two
    2. {current} {list Item Three} {end} {list Item Four}
    {template end}
  17. 17. ACP EvolvedACP has evolved considerablyVersion 2.0Language featuresOn the fly CSS injectionFormat-specific patterns (html, feed, raw)Access to Joomla environment
  18. 18. Basic ACP ExampleArticle Biography Pattern{acp _pattern biography}
    {name Jane Doe}{acp var name}{title CEO}{acp ifdef title}{body/}, {acp var title}one or more paragraphs here{acp end title}{/body}{acp _end} {acp var body}
  19. 19. Basic ACP ExampleArticle Biography HTML{acp _pattern biography}
    {name Jane Doe}Jane Doe, CEO{title CEO} one or more paragraphs here{body/}
    one or more paragraphs here{/body}{acp _end}
  20. 20. ACP as a Content CreatorObjective: keep it simple{acp _command parameters}definition/selection directives{acp _end}Top Level Commands are:_pattern, _globals, _with
  21. 25. The Power of _WithWith selects articles, then applies a patternOnly article globals are availableSurprisingly powerful feature {acp _with pattern} {article alias or id...} {category catalias or catid...} {acp _end}
  22. 26. Processing in a With CommandFinal ArticlePattern Master Article Resolved Article Pattern Reference withArticle Selectors Resolved Article ACPResolved Article SelectedSelectedSelected Selected SelectedArticlesArticles ArticlesResolved Article ArticlesArticles ACP GlobalsACP GlobalsACP Globals ACP Globals ACP GlobalsResolved Article
  23. 27. ACP as a DeveloperACP has a rich command setVariable spaces: var, article, request, withConditionals: if, ifdef, ifempty, ifviewLooping: for, foreachStyles: cssMore: set, transform, ...
  24. 28. Example: Case Studies
  25. 29. Example: Case Studies
  26. 30. Example: Case StudiesThe main article:{acp _with bizcase}{category business-cases}{acp _end}
  27. 37. Example: Multiple PresentationsExtension Thumbnail
  28. 38. Example: Multiple PresentationsBlog Title{acp ifdef fptitle}{acp var fptitle}{acp else fptitle}{acp var @with.title}{acp end fptitle}{acp ifdef new} NEW!{acp end new}