From design to Plone site. XDV-driven Plone theming.


Published on

Slides from Denys Mishunov's talk at Plone Conference 2009 in Budapest

Published in: Technology, Design
1 Comment
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Plone is a wonderful tool. It’s very flexible and very powerful. When it comes to a Plone theme it’s still flexible, it’s still powerful… but it’s not easy at all.

    If you only consider starting with Plone - learning curve and knowledge requirements for starting a Plone theme might be very steep and not inspiring these days.

    You can’t just pick any free HTML/CSS theme out there and make it work in Plone. Days and maybe weeks of work are waiting for you in order to make such theme “Plone-compatible”.
  • You want to go table-less, change DOCTYPE or use any advanced structure for your Plone theme? Good luck in doing and maintaining it. A 3rd-party product or next Plone’s version might make you cry.
  • Those who tried to migrate a Plone theme from 2.5 to 3.0...
  • ... that was a challenge, wasn’t it? Of course after all you have decided to make the Plone 3.0 theme from scratch. But I know this feeling: “It just can’t be that hard. Plone is great and it should be easy to migrate a theme. There should be a button somewhere to do just that, right?”
  • Yes, we have made a lot of mistakes in Plone when it comes to Plone themes. But...
  • We realize that it should be easier to make a new Plone theme, and here's where we're heading with that in Plone 5.

    Wouldn’t it be wonderful to make Plone themes in a more relaxed manner, with much more freedom and definitely with less knowledge required? Not to worry a lot about migration of a theme? To be able to pick a theme from or and make it a Plone theme without hitting your head against a brick wall?

    A couple of new approaches are already here, ready to serve.
  • A new technology comes to rescue - Deliverance. To be very brief - from a Plone integrator’s point of view it is the tool that takes responsibility of applying your static HTML/CSS theme to a site. It can even be not Plone site at all. Deliverance maintained by Ian Biking these days, went way beyond it’s original idea by Paul Everit and is much more than just a Plone theming tool. In the context of a Plone theme rather think of it as a replacement for your
  • XDV stands for XSLT Deliverance.

    Faster sibling of Deliverance.

    Though Deliverance and XDV are different tools with slightly different ideas, in general XDV does the same - applies a static theme to your Plone site. is running on XDV so its mature enough for serious deployments by the time.
  • Deliverance is a bit more complex to set up for proper production use these days, a bit more powerful, and possibly a good choice if you're looking to integrate many different applications like Plone, Trac, .NET applications and such into a single look and feel, or if you have a lot of different templates.
    XDV is the stripped down version of Deliverance that is based on original idea of Deliverance. In this talk we are going to investigate XDV way of theming a Plone site because of it being faster, it’s simpler installation and one additional tool that might change the way you do a Plone theme.
  • The last for now but not least step towards happy life of the Plone theme integrators - collective.xdv package developed by Martin Aspeli, which makes XDV for Plone just one additional package away.

    Obvious advantage for the Plone theme integrators - collective.xdv is the tool that lets one use XDV power without additional server-side tools and settings which Deliverance and pure XDV require. So further in the talk we will review how to use collective.xdv as the simplest way to get involved with XDV especially for Plone theme integrators.

    In general it should be not hard to switch between Deliverance and XDV if you need to because they use similar ideas and approaches. Details differ though.

    You might consider using collective.xdv if:
    your only task is to style a Plone site you can use collective.xdv. collective.xdv is Plone dependent and is not supposed to work with any other tool. While Deliverance and XDV can be used to style any web-based tools like Trac, WordPress and such (not necessary Plone-based) as well.
    you don’t feel like setting up proxy, WSGI, Apache and such (most Plone theme integrators don’t want to do that) you might consider using collective.xdv.

    You might consider trying another tool if:

    If you already have a Plone theme done, switching to collective.xdv will not gain you anything. Stay where you are.
    You need to style more than just a Plone site - your customer has corporate identity and needs intranet, public site, Trac instance, their favorite blog and other applications to be styles with the same visual theme. In this case you might still consider developing the theme with Plone and collective.xdv. But for deployment you will need to use pure XDV or Deliverance with all server-side technologies required and without collective.xdv dependancy.
  • From an integrator’s point of view XDV is based on 2 main points: XML rules and static HTML of your theme.

    By using these XML rules XDV imposes the theme on the generated pages.
  • There is no strict requirement to HTML file. XDV can be pretty much happy with invalid or not well-formed HTML. It is not even necessary to have it XML formatted. XDV does pretty good job for you by fixing your HTML “on the fly” when theme transformation happens.

    There is one advise though.
    To make your life easier it is a good idea to follow basic IDs and classes of Plone for the elements that you assume will be replaced with the content from Plone. This will let you just copy some styles from Plone later if you don’t have styles for those elements in your stylesheets.
  • Example
    <copy content="//*[@id='portal-footer']/*" theme="//*[@id='footer']" />

    You specify a piece of content in your Plone site and an HTML element in your static theme which XDV should glue together.

    For specifying both - the piece of content in the Plone site and the HTML element in the theme XPath is used. XDV doesn’t support CSS selectors, but it’s very easy to get XPath. We will see how in the practical part of the talk. We will also review rules, supported by XDV.
  • What’s the real benefit of using XDV?
  • We will find out how to integrate a visual theme into your Plone site using collective.xdv in the next, practical part of this talk.
  • From design to Plone site. XDV-driven Plone theming.

    1. 1. From design to Plone site. XDV-driven Plone theming Denys Mishunov Jarn AS
    2. 2. From design to Plone site. XDV-driven Plone theming Denys Mishunov Jarn AS
    3. 3. This is Painful
    4. 4. even this is painful
    5. 5. Deliverance
    6. 6. XDV (XSLT Deliverance)
    7. 7. XDV vs. Deliverance
    8. 8. collective.xdv
    9. 9. XDV XML HTML Rules
    10. 10. <copy content="//*[@id='portal-footer']/*" theme="//*[@id='footer']" />
    11. 11. <copy content="//*[@id='portal-footer']/*" theme="//*[@id='footer']" />
    12. 12. <copy content="//*[@id='portal-footer']/*" theme="//*[@id='footer']" />
    13. 13. <copy content="//*[@id='portal-footer']/*" theme="//*[@id='footer']" />
    14. 14. • Theme without Plone; • use any HTML/CSS • no main_template dependancy • migrate without a headache
    15. 15. Practice
    16. 16. (Plone) content (Static) theme BEFORE
    17. 17. (Plone) content (Static) theme DROP
    18. 18. (Plone) content (Static) theme REPLACE
    19. 19. (Plone) content (Static) theme PREPEND
    20. 20. (Plone) content (Static) theme COPY
    21. 21. (Plone) content (Static) theme PREPEND APPEND
    22. 22. (Plone) content (Static) theme AFTER
    23. 23. Creampuff NF Creampuff NF Creampuff NF Creampuff NF
    24. 24. Nick Curtis
    25. 25. Questions