TheodoRogerCMSBundle

 TheodoRogerCMSBundle

Presentation of the RogerCMS Bundle

79637b39737f884d090cac0d7c768351?s=128

Benjamin Grandfond

June 11, 2012
Tweet

Transcript

  1. RogerCms A developer friendly CMS by Benjamin Grandfond & Marek

    Kalnik 1 1
  2. About us 2 2

  3. Benjamin Grandfond @benjaM1 http://github.com/benja-M-1 http://benjamingrandfond.fr • Project Manager @ Theodo

    • Symfony user since 2009 • Creator of Symfttpd [symfy] 2.0 • Creator of http://parisstreetpingpong.fr 3 3
  4. Marek Kalnik @marekkalnik http://github.com/marekkalnik http://marekkalnik.tumblr.com • Lead Developer @ Theodo

    • Release Manager for RogerCMS • Zend Certified PHP 5.3 Engineer • JavaScript junkie 4 4
  5. Why? 5 5

  6. The idea 6 • we need a tool to let

    our clients modify those "about us" pages (or phone numbers) • we don't want them touch anything else • we want to keep our templates where we like them to be (in the project directory, as static files) 6
  7. The idea • we need a tool to let our

    clients modify those "about us" pages (or phone numbers) • we don't want them touch anything else • we want to keep our templates where we like them to be (in the project directory, as static files) 7 7
  8. The idea • we need a tool to let our

    clients modify those "about us" pages (or phone numbers) • we don't want them touch anything else • we want to keep our templates where we like them to be (in the project directory, as static files) 8 8
  9. The idea • we need a tool to let our

    clients modify those "about us" pages (or phone numbers) • we don't want them touch anything else • we want to keep our templates where we like them to be (in the project directory, as static files) 9 9
  10. The idea • we need a tool to let our

    clients modify those "about us" pages (or phone numbers) • we don't want them touch anything else • we want to keep our templates where we like them to be (in the project directory, as static files) So we want a CMS that can be easily integrated into a Symfony project. 10 10
  11. History 11 11

  12. History Fabien Potencier to Fabrice Bernhard: "I really like how

    RadiantCMS is made, I think it would be great to make a Symfony2 CMS like that. Could you do that?" 12 12
  13. History Fabrice Bernhard: 13 13

  14. History 14 14

  15. History • started summer 2011 right after Symfony 2.0 release

    • first Symfony2 project @Theodo • used in several projects like www.smartangels.fr, www.epigraf.com.pl • made us contribute to Symfony ;) • publicly released on Github december 2011 15 15
  16. History • started summer 2011 right after Symfony 2.0 release

    • first Symfony2 project @Theodo • used in several projects like www.smartangels.fr, www.epigraf.com.pl • made us contribute to Symfony ;) • publicly released on Github december 2011 16 16
  17. History • started summer 2011 right after Symfony 2.0 release

    • first Symfony2 project @Theodo • used in several projects like www.smartangels.fr, www.epigraf.com.pl • made us contribute to Symfony ;) • publicly released on Github december 2011 17 17
  18. History • started summer 2011 right after Symfony 2.0 release

    • first Symfony2 project @Theodo • used in several projects like www.smartangels.fr, www.epigraf.com.pl • made us contribute to Symfony ;) • publicly released on Github december 2011 18 18
  19. • started summer 2011 right after Symfony 2.0 release •

    first Symfony2 project @Theodo • used in several projects like www.smartangels.fr, www.epigraf.com.pl • made us contribute to Symfony ;) • publicly released on Github december 2011 History 19 19
  20. History • started summer 2011 right after Symfony 2.0 release

    • first Symfony2 project @Theodo • used in several projects like www.smartangels.fr, www.epigraf.com.pl • made us contribute to Symfony ;) • publicly released on Github december 2011 20 20
  21. History 21 21

  22. How does it work? 22 22

  23. It’s twig 23 How does it work? {# layout ‘normal’

    #} <html> <head> <title>{% block title %}No title{% endblock %}</title> </head> <body> <div id="container"> {% block content %}{% endblock %} </div> <hr /> <div id="footer"> {% block footer %}{% endblock %} </div> </body> </html> 23
  24. 24 {# Your template #} {% extends "layout:name" %} <div

    class="foo"> {% block content %} bar content {% endblock %} </div> Using of layout from the CMS It’s twig How does it work? 24
  25. It’s developer friendly 25 public function pageAction() { // ...

    $page = $this->get('roger.content_repository')->getPageBySlug('contact'); $variables = array( 'form' => $form->createView(), ); return $this->get('roger.templating') ->renderResponse('page:'.$page->getName(), array('page' => $page) + $variables); } Injecting variables into a CMS page Using pages in controllers How does it work? 25
  26. 4 objects 26 How does it work? 26

  27. layout 27 • HTML page structure • declare Twig blocks

    How does it work? 27
  28. page 28 • add content to Twig blocks • set

    up HTML metas • configure the page cache • publish / draft • link to other pages How does it work? 28
  29. snippet 29 • special Twig tag • add shared content

    (copyrights, ...) How does it work? 29
  30. media 30 • manage images How does it work? 30

  31. layout page <p>this is foo content</p> <div>Hello</div> {% snippet ‘foosnip’

    %} {% block foo %}{% endblock %} {% block bar %}{% endblock %} {% block baz %}{% endblock %} snippet <span> This is a sample </span> block ‘bar’ block ‘foo’ 31 How does it work? 31
  32. Routing 32 Products Rackets Performance products rackets performance Pages Slugs

    Urls http://tennis.foo.com/products http://tennis.foo.com/products/rackets http://tennis.foo.com/products/rackets/performance How does it work? 32
  33. Routing 33 Products Rackets Performance products rackets performance Pages Slugs

    Urls http://tennis.foo.com/products http://tennis.foo.com/products/rackets http://tennis.foo.com/products/rackets/performance How does it work? 33
  34. Routing 34 Products Rackets Performance products rackets performance Pages Slugs

    Urls http://tennis.foo.com/products http://tennis.foo.com/products/rackets http://tennis.foo.com/products/rackets/performance How does it work? 34
  35. Routing 35 Products Rackets Performance products rackets performance Pages Slugs

    Urls http://tennis.foo.com/products http://tennis.foo.com/products/rackets http://tennis.foo.com/products/rackets/performance How does it work? 35
  36. Security? 36 36

  37. Security? • based in Symfony2 security system • need more?

    Have you tried FOSUserBundle? :) 37 37
  38. Security? • based in Symfony2 security system • need more?

    Have you tried FOSUserBundle? :) 38 38
  39. Security? • based in Symfony2 security system • need more?

    Have you tried FOSUserBundle? :) 39 39
  40. Security? 40 Only roles matter! role_hierarchy: ROLE_ROGER_CONTENT: [ROLE_ROGER_READ_CONTENT, ROLE_ROGER_WRITE_CONTENT, ROLE_ROGER_DELETE_CONTENT,

    ROLE_ROGER_PUBLISH_CONTENT] ROLE_ROGER_DESIGN: [ROLE_ROGER_READ_DESIGN, ROLE_ROGER_WRITE_DESIGN, ROLE_ROGER_DELETE_DESIGN] ROLE_ROGER_EDITOR: [ROLE_ROGER_CONTENT, ROLE_ROGER_READ_DESIGN, ROLE_ROGER_PUBLISHER] ROLE_ROGER_DESIGNER: [ROLE_ROGER_CONTENT, ROLE_ROGER_DESIGN, ROLE_ROGER_PUBLISHER] ROLE_ADMIN: [ROLE_USER, ROLE_ROGER_DESIGNER, ROLE_ROGER_EDITOR] ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] 40
  41. Demo time :) 41 41

  42. Demo :) 42 Just like that (Or see the project's

    sandbox) https://github.com/theodo/rogercms-sandbox 42
  43. Thank you! 43 43

  44. Questions 44 Contribute! https://github.com/theodo/TheodoRogerCmsBundle https://github.com/theodo/rogercms-sandbox Feedback! @benjaM1 @marekkalnik 44