SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Downloaden Sie, um offline zu lesen
Upgrading a Plone 3 Theme for
 Plone 4: Beyond the Basics
What’s changed?
Tutorial on Plone.org will get you started
Plone 4 has a new theme:
        Sunburst
Plone 4 also includes
•  Plone Classic –       •  Plone Default –
   The default Plone 3      A barebones template
   theme                    with no styling
Updates to main_template.pt
•  Defines on the html tag have been modified
•  Some new defines have been added to the
   body tag
•  Viewlet managers formerly in content area
   have been moved to main_template
•  New slot called "content-core" has been
   added for the content body
Updates to template variables
•  Many global template variables are no longer
   available
   Good news: speed!
   Bad news: you must define them to use them

  NameError: name 'templateId' is
  not defined

•  Examples: template_id, toLocalizedTime, portal,
   isAnon, member . . . many more (see docs on
   Plone.org)
Moved viewlet managers / macros
•  Document title, description,
   abovecontenttitle, belowcontenttitle,
   abovecontentbody, belowcontentbody,
   relateditems - out of content templates and
   into main
•  Keywords in belowcontent, not in
   belowcontenttitle
•  Contenthistory a link in documentbyline, not
   in belowcontentbody
Review all your custom templates
  to see whether your theme is
             affected
Update the “based-on” declarations
     in Generic Setup profiles
•  Skin paths (skins.xml) and viewlet managers
   (viewlets.xml) should be based on “Plone
   Classic Theme” instead of “Plone Default”

 <order manager="plone.portaltop"
 skinname="UCLA Default Theme" based-
 on="Plone Classic Theme">
Update the theme specific interface
•  Subclass the interface from Plone Classic
   Theme (not IDefaultPloneLayer) in browser/
   interfaces.py

from plonetheme.classic.browser.interfaces
  import IThemeSpecific as IClassicTheme

class IThemeSpecific(IClassicTheme):
      """theme-specific layer"""
But, but …
•  What if I want my theme to be compatible
   with Plone 3 and Plone 4?
•  Why are my viewlets showing up all over?
•  What’s with the personal bar?
•  How do I deal with the new visual editor,
   TinyMCE?
•  Where are the CSS selectors I was using?
•  My overlays are whack!
Preserving Plone 3 compatibility
•  Add a dependency on plonetheme.classic – so
   imports don’t fail in your Plone 3 sites
•  In setup.py:
    install_requires=[
          'setuptools',
          # -*- Extra requirements: -*-
          'plonetheme.classic',
    ],
Plone 3 compatibility (cont.)
•  In configure.zcml:
  <includeDependencies package="." />


•  In profiles/default/metadata.xml:
  <dependencies>
    <dependency>profile-
  plonetheme.classic:default</dependency>
  </dependencies>
Viewlet changes
•  plone.personal_bar – in plone.portalheader
   instead of plone.portaltop
•  plone.site_actions – in plone.portalfooter
   instead of plone.portalheader
•  plone.path_bar – in plone.abovecontent
   instead of plone.portaltop
•  plone.abovecontent viewlet manager comes
   before plone.contentviews
Controlling viewlets
•  Use viewlets.xml to hide duplicate viewlets
•  Show them again on uninstall
•  Use conditional zcml to register viewlets as
   needed for Plone 3 or Plone 4
Conditional ZCML Example
<!-- Plone 3 condition check-->
<configure zcml:condition="not-installed plone.app.upgrade">
   <browser:viewlet
      name="plone.personal_bar”
      manager="plone.app.layout.viewlets.interfaces.IPortalTop"
      . . . />
</configure>
<!-- Plone 4 condition check-->
<configure zcml:condition="installed plone.app.upgrade">
  <browser:viewlet
      name="plone.personal_bar”
      manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
      . . . />
</configure>
Adjust to the personal bar in Plone 4
•  Has the .actionMenu class – dropdown
   behavior and green styles
•  Is structured as definition list (dl) rather than
   unordered list (ul)
•  May need to write new styles, to:
   Render the options inline (old-fashioned way)
   Coordinate with your site design (avoid the
    green)
•  Includes Site Setup link – hurray!
TinyMCE in addition to Kupu
•  May need to define new styles for TinyMCE
   editor
•  Kupu had:
   .kupu-html body
•  TinyMCE has:
   body.mceContentBody
CSS changes
•  .documentContent and #region-content are
   gone – use #content, #content-core, or other
   selectors
•  .documentEditable comes later, after
   abovecontent viewlet and status messages
•  #content ul and #content li a override styles
   for .configlets – use #content ul.configlets
   and #content ul.configlets li a
Styling overlays
•  Target .pb-ajax and its children
Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)
DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)
DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)
Drupaltour
 
How to Get Started Theming Plone
How to Get Started Theming PloneHow to Get Started Theming Plone
How to Get Started Theming Plone
cdw9
 
Word press templates
Word press templatesWord press templates
Word press templates
Dan Phiffer
 

Was ist angesagt? (20)

Doing Things the WordPress Way
Doing Things the WordPress WayDoing Things the WordPress Way
Doing Things the WordPress Way
 
I use drupal / 我是 OO 師,我用 Drupal
I use drupal / 我是 OO 師,我用 DrupalI use drupal / 我是 OO 師,我用 Drupal
I use drupal / 我是 OO 師,我用 Drupal
 
Drupal 7 Theme System
Drupal 7 Theme SystemDrupal 7 Theme System
Drupal 7 Theme System
 
Fronteers - Drupal 7 ux
Fronteers   - Drupal 7 uxFronteers   - Drupal 7 ux
Fronteers - Drupal 7 ux
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practices
 
MuleSoft ESB Shared Library
MuleSoft ESB Shared LibraryMuleSoft ESB Shared Library
MuleSoft ESB Shared Library
 
Introduction to Module Development (Drupal 7)
Introduction to Module Development (Drupal 7)Introduction to Module Development (Drupal 7)
Introduction to Module Development (Drupal 7)
 
Your first d8 module
Your first d8 moduleYour first d8 module
Your first d8 module
 
Debugging in drupal 8
Debugging in drupal 8Debugging in drupal 8
Debugging in drupal 8
 
Installing AtoM with Ansible
Installing AtoM with AnsibleInstalling AtoM with Ansible
Installing AtoM with Ansible
 
Brisbane Drupal meetup - 2016 Mar - Build module in Drupal 8
Brisbane Drupal meetup - 2016 Mar - Build module in Drupal 8Brisbane Drupal meetup - 2016 Mar - Build module in Drupal 8
Brisbane Drupal meetup - 2016 Mar - Build module in Drupal 8
 
How To Write Your First Firefox Extension
How To Write Your First Firefox ExtensionHow To Write Your First Firefox Extension
How To Write Your First Firefox Extension
 
Plone Theming in a Nutshell
Plone Theming in a NutshellPlone Theming in a Nutshell
Plone Theming in a Nutshell
 
Intro to TAL
Intro to TALIntro to TAL
Intro to TAL
 
Introduction to Drupal (7) Theming
Introduction to Drupal (7) ThemingIntroduction to Drupal (7) Theming
Introduction to Drupal (7) Theming
 
DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)
DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)
DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)
 
How to Get Started Theming Plone
How to Get Started Theming PloneHow to Get Started Theming Plone
How to Get Started Theming Plone
 
Local Drupal MultiSite Set-up
Local Drupal MultiSite Set-upLocal Drupal MultiSite Set-up
Local Drupal MultiSite Set-up
 
Word press templates
Word press templatesWord press templates
Word press templates
 
PSD to a Drupal Theme (using a base theme)
PSD to a Drupal Theme (using a base theme)PSD to a Drupal Theme (using a base theme)
PSD to a Drupal Theme (using a base theme)
 

Andere mochten auch (7)

Jumpstart Your Development with ZopeSkel
Jumpstart Your Development with ZopeSkelJumpstart Your Development with ZopeSkel
Jumpstart Your Development with ZopeSkel
 
OOTB Presentation
OOTB PresentationOOTB Presentation
OOTB Presentation
 
Troubleshooting Plone
Troubleshooting PloneTroubleshooting Plone
Troubleshooting Plone
 
Melhores Práticas para o Desenvolvimento com Plone 4
Melhores Práticas para o Desenvolvimento com Plone 4Melhores Práticas para o Desenvolvimento com Plone 4
Melhores Práticas para o Desenvolvimento com Plone 4
 
How not to develop with Plone
How not to develop with PloneHow not to develop with Plone
How not to develop with Plone
 
Building Content Types with Dexterity
Building Content Types with DexterityBuilding Content Types with Dexterity
Building Content Types with Dexterity
 
Leveraging Plone for Search Engine Optimization (SEO)
Leveraging Plone for Search Engine Optimization (SEO)Leveraging Plone for Search Engine Optimization (SEO)
Leveraging Plone for Search Engine Optimization (SEO)
 

Ähnlich wie Upgrading a Plone 3 Theme for Plone 4: Beyond the Basics

Magento 2.0: Prepare yourself for a new way of module development
Magento 2.0: Prepare yourself for a new way of module developmentMagento 2.0: Prepare yourself for a new way of module development
Magento 2.0: Prepare yourself for a new way of module development
Ivan Chepurnyi
 
Theming tips and tricks
Theming tips and tricksTheming tips and tricks
Theming tips and tricks
aaroncouch
 

Ähnlich wie Upgrading a Plone 3 Theme for Plone 4: Beyond the Basics (20)

Plone 5 theming
Plone 5 themingPlone 5 theming
Plone 5 theming
 
Plone 5 theming
Plone 5 themingPlone 5 theming
Plone 5 theming
 
D8 training
D8 trainingD8 training
D8 training
 
Pragmatic plone projects
Pragmatic plone projectsPragmatic plone projects
Pragmatic plone projects
 
Magento mega menu extension
Magento mega menu extensionMagento mega menu extension
Magento mega menu extension
 
Pragmatische Plone Projekte
Pragmatische Plone ProjektePragmatische Plone Projekte
Pragmatische Plone Projekte
 
Oenology
OenologyOenology
Oenology
 
Develop Basic joomla! MVC component for version 3
Develop Basic joomla! MVC component for version 3Develop Basic joomla! MVC component for version 3
Develop Basic joomla! MVC component for version 3
 
Magento 2.0: Prepare yourself for a new way of module development
Magento 2.0: Prepare yourself for a new way of module developmentMagento 2.0: Prepare yourself for a new way of module development
Magento 2.0: Prepare yourself for a new way of module development
 
Theming tips and tricks
Theming tips and tricksTheming tips and tricks
Theming tips and tricks
 
Magento 2 theming - knowledge sharing session by suman kc
Magento 2 theming - knowledge sharing session by suman kcMagento 2 theming - knowledge sharing session by suman kc
Magento 2 theming - knowledge sharing session by suman kc
 
Drupal 8 Configuration Management
Drupal 8 Configuration ManagementDrupal 8 Configuration Management
Drupal 8 Configuration Management
 
Design to Theme @ CMSExpo
Design to Theme @ CMSExpoDesign to Theme @ CMSExpo
Design to Theme @ CMSExpo
 
templates in Django material : Training available at Baabtra
templates in Django material : Training available at Baabtratemplates in Django material : Training available at Baabtra
templates in Django material : Training available at Baabtra
 
Creating custom themes in AtoM
Creating custom themes in AtoMCreating custom themes in AtoM
Creating custom themes in AtoM
 
Drupaldelphia 2013 Presentation- Making Your Site more Friendly to Search Eng...
Drupaldelphia 2013 Presentation- Making Your Site more Friendly to Search Eng...Drupaldelphia 2013 Presentation- Making Your Site more Friendly to Search Eng...
Drupaldelphia 2013 Presentation- Making Your Site more Friendly to Search Eng...
 
World Plone Day 2012 Taipei
World Plone Day 2012 TaipeiWorld Plone Day 2012 Taipei
World Plone Day 2012 Taipei
 
Synapse india reviews on drupal intro
Synapse india reviews on drupal introSynapse india reviews on drupal intro
Synapse india reviews on drupal intro
 
SynapseIndia drupal presentation on drupal best practices
SynapseIndia drupal  presentation on drupal best practicesSynapseIndia drupal  presentation on drupal best practices
SynapseIndia drupal presentation on drupal best practices
 
Creating a basic joomla
Creating a basic joomlaCreating a basic joomla
Creating a basic joomla
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Upgrading a Plone 3 Theme for Plone 4: Beyond the Basics

  • 1. Upgrading a Plone 3 Theme for Plone 4: Beyond the Basics
  • 3. Tutorial on Plone.org will get you started
  • 4. Plone 4 has a new theme: Sunburst
  • 5. Plone 4 also includes •  Plone Classic – •  Plone Default – The default Plone 3 A barebones template theme with no styling
  • 6. Updates to main_template.pt •  Defines on the html tag have been modified •  Some new defines have been added to the body tag •  Viewlet managers formerly in content area have been moved to main_template •  New slot called "content-core" has been added for the content body
  • 7. Updates to template variables •  Many global template variables are no longer available  Good news: speed!  Bad news: you must define them to use them NameError: name 'templateId' is not defined •  Examples: template_id, toLocalizedTime, portal, isAnon, member . . . many more (see docs on Plone.org)
  • 8. Moved viewlet managers / macros •  Document title, description, abovecontenttitle, belowcontenttitle, abovecontentbody, belowcontentbody, relateditems - out of content templates and into main •  Keywords in belowcontent, not in belowcontenttitle •  Contenthistory a link in documentbyline, not in belowcontentbody
  • 9. Review all your custom templates to see whether your theme is affected
  • 10. Update the “based-on” declarations in Generic Setup profiles •  Skin paths (skins.xml) and viewlet managers (viewlets.xml) should be based on “Plone Classic Theme” instead of “Plone Default” <order manager="plone.portaltop" skinname="UCLA Default Theme" based- on="Plone Classic Theme">
  • 11. Update the theme specific interface •  Subclass the interface from Plone Classic Theme (not IDefaultPloneLayer) in browser/ interfaces.py from plonetheme.classic.browser.interfaces import IThemeSpecific as IClassicTheme class IThemeSpecific(IClassicTheme): """theme-specific layer"""
  • 12. But, but … •  What if I want my theme to be compatible with Plone 3 and Plone 4? •  Why are my viewlets showing up all over? •  What’s with the personal bar? •  How do I deal with the new visual editor, TinyMCE? •  Where are the CSS selectors I was using? •  My overlays are whack!
  • 13. Preserving Plone 3 compatibility •  Add a dependency on plonetheme.classic – so imports don’t fail in your Plone 3 sites •  In setup.py: install_requires=[ 'setuptools', # -*- Extra requirements: -*- 'plonetheme.classic', ],
  • 14. Plone 3 compatibility (cont.) •  In configure.zcml: <includeDependencies package="." /> •  In profiles/default/metadata.xml: <dependencies> <dependency>profile- plonetheme.classic:default</dependency> </dependencies>
  • 15. Viewlet changes •  plone.personal_bar – in plone.portalheader instead of plone.portaltop •  plone.site_actions – in plone.portalfooter instead of plone.portalheader •  plone.path_bar – in plone.abovecontent instead of plone.portaltop •  plone.abovecontent viewlet manager comes before plone.contentviews
  • 16. Controlling viewlets •  Use viewlets.xml to hide duplicate viewlets •  Show them again on uninstall •  Use conditional zcml to register viewlets as needed for Plone 3 or Plone 4
  • 17. Conditional ZCML Example <!-- Plone 3 condition check--> <configure zcml:condition="not-installed plone.app.upgrade"> <browser:viewlet name="plone.personal_bar” manager="plone.app.layout.viewlets.interfaces.IPortalTop" . . . /> </configure> <!-- Plone 4 condition check--> <configure zcml:condition="installed plone.app.upgrade"> <browser:viewlet name="plone.personal_bar” manager="plone.app.layout.viewlets.interfaces.IPortalHeader" . . . /> </configure>
  • 18. Adjust to the personal bar in Plone 4 •  Has the .actionMenu class – dropdown behavior and green styles •  Is structured as definition list (dl) rather than unordered list (ul) •  May need to write new styles, to:  Render the options inline (old-fashioned way)  Coordinate with your site design (avoid the green) •  Includes Site Setup link – hurray!
  • 19. TinyMCE in addition to Kupu •  May need to define new styles for TinyMCE editor •  Kupu had: .kupu-html body •  TinyMCE has: body.mceContentBody
  • 20. CSS changes •  .documentContent and #region-content are gone – use #content, #content-core, or other selectors •  .documentEditable comes later, after abovecontent viewlet and status messages •  #content ul and #content li a override styles for .configlets – use #content ul.configlets and #content ul.configlets li a
  • 21. Styling overlays •  Target .pb-ajax and its children