|
| 1 | +# Plone Classic UI Theming based on Barceloneta |
| 2 | + |
| 3 | +Theming based on a filesystem package without any dependency. |
| 4 | + |
| 5 | +* Theming for Plone 6 Classic UI |
| 6 | +* Theme stored in a filesystem package |
| 7 | +* Built from scratch |
| 8 | +* No dependencies to Barceloneta |
| 9 | +* No Diazo needed |
| 10 | + |
| 11 | + |
| 12 | +# Theme Package |
| 13 | + |
| 14 | +* Create a theme package as explained here. |
| 15 | +* Temove what you do not need |
| 16 | +* Add [package.json](https://github.com/collective/plonetheme.munich/blob/master/package.json) |
| 17 | +* Overrides |
| 18 | +* Static files |
| 19 | + |
| 20 | + |
| 21 | +# Static Files |
| 22 | + |
| 23 | +Register directory to keep static files |
| 24 | + |
| 25 | +File: src/plonetheme/munich/browser/configure.zcml |
| 26 | +Directory: src/plonetheme/munich/browser/static |
| 27 | + |
| 28 | +``` |
| 29 | +<!-- Publish static files --> |
| 30 | +<plone:static |
| 31 | + name="plonetheme.munich" |
| 32 | + type="plone" |
| 33 | + directory="static" |
| 34 | + /> |
| 35 | +``` |
| 36 | + |
| 37 | +# Theme |
| 38 | + |
| 39 | +## Manifest |
| 40 | + |
| 41 | +* Manifest for your theme |
| 42 | +* Keep rules empty to disable Diazo |
| 43 | + |
| 44 | +``` |
| 45 | +[theme] |
| 46 | +title = Munich Theme |
| 47 | +description = A modernized Plone 6 theme |
| 48 | +preview = preview.png |
| 49 | +rules = |
| 50 | +prefix = /++theme++plonetheme.munich |
| 51 | +doctype = <!DOCTYPE html> |
| 52 | +``` |
| 53 | + |
| 54 | +## Bundle Registration |
| 55 | + |
| 56 | +``` |
| 57 | +<?xml version="1.0"?> |
| 58 | +<registry |
| 59 | + xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
| 60 | + i18n:domain="plonetheme.munich"> |
| 61 | +
|
| 62 | + <records interface="Products.CMFPlone.interfaces.IBundleRegistry" prefix="plone.bundles/munich"> |
| 63 | + <value key="jscompilation">++theme++munich/js/munich.min.js</value> |
| 64 | + <value key="csscompilation">++theme++munich/css/munich.min.css</value> |
| 65 | + <value key="enabled">True</value> |
| 66 | + <value key="compile">False</value> |
| 67 | + <value key="last_compilation">2020-12-06 12:00:00</value> |
| 68 | + </records> |
| 69 | +
|
| 70 | +</registry> |
| 71 | +``` |
| 72 | + |
| 73 | +## Theme Registration |
| 74 | + |
| 75 | +Register your theme via theme.xml |
| 76 | + |
| 77 | +``` |
| 78 | +<?xml version="1.0" encoding="UTF-8"?> |
| 79 | +<theme> |
| 80 | + <name>munich</name> |
| 81 | + <enabled>true</enabled> |
| 82 | +</theme> |
| 83 | +``` |
| 84 | + |
| 85 | +## Compile the bundle |
| 86 | + |
| 87 | +* Compile SASS to SCSS |
| 88 | + |
| 89 | +Install all requirements and dependencies from package.json: |
| 90 | + |
| 91 | +``` |
| 92 | +yarn install |
| 93 | +``` |
| 94 | + |
| 95 | +Build the actual bundle: |
| 96 | + |
| 97 | +``` |
| 98 | +yarn dist |
| 99 | +``` |
| 100 | + |
| 101 | + |
| 102 | +# Theming |
| 103 | + |
| 104 | +* Make use of Bootstrap [variables](https://github.com/twbs/bootstrap/blob/main/scss/_variables.scss) |
| 105 | +* Tweak basic settings like rounded corners, shadows, etc. |
| 106 | +* Set custom fonts |
| 107 | +* Define your own stuff |
| 108 | +* Import Boostrap (as basis) |
| 109 | + |
| 110 | +## Templates |
| 111 | + |
| 112 | +* Add z3c.jbot overrides |
| 113 | +* Copy Templates to customize |
| 114 | +* Add custom views for your story |
| 115 | + |
| 116 | + |
| 117 | +# Available Themes |
| 118 | + |
| 119 | +* plonetheme.tokyo (mobile first, onw column) |
| 120 | +* plonetheme.munic (minimalistic) |
| 121 | +* plonetheme.berlin (based on Barceloneta) |
0 commit comments