plone / training

Plone Trainings
https://training.plone.org
Creative Commons Attribution 4.0 International
58 stars 89 forks source link

Broken steps in theme-package.html#css-and-js-resources #174

Closed davilima6 closed 8 years ago

davilima6 commented 9 years ago

This section tells to register resources twice: once in registry.xml and then again in manifest.cfg inside the implicit Diazo bundle:

This is wrong and results in duplicate bundles output as seen in plone/Products.CMFPlone#1220.

Trainers, please should choose one way or another and make the difference explicit.

davilima6 commented 9 years ago

/cc @pbauer @fulv @MrTango

MrTango commented 9 years ago

Hi @davilima6, thx for feedback. Actually we decided to rewrite the theming docs to not use the ResourceRegistry anymore. Because for theming it is not needed anymore. We can use the Diazo bundle in the manifest.cfg now as you stated and also rebuild the css from the Theming Editor.

This makes the theming docs much simpler and easier to understand. We will provide a gulp and grunt example on how to build your setup and that's it.

So no ./bin/plone-compile-resources and the whole dependencies and problems with it anymore.

That's the plan, but I couldn't find time to work on it by now. I hope that I can finish this until the end of the year.

davilima6 commented 9 years ago

Thanks, this is good news! I see that you assigned the issue to me. Would you like me to remove current references to registry.xml so other devs don't get lost in the meantime?

Also I think it'd be valuable to have an "info box" telling readers/trainees that registry.xml is available and useful for some cases, ie:

fulv commented 9 years ago

@MrTango I have tried plonetheme.tango without registry.xml, but when I go to the theme editor and try to rebuild the css from there, it just hangs (no errors anywhere).

MrTango commented 9 years ago

@fulv by now it will not work with the Editor rebuild. That build function was introduced after i started with the registry way. I think the build button need some changes in the manifest.cfg to work. But all in all, if you don't need the variables from the registry like the colors, just use a simple Gulp or Grunt setup to build the css files and put it into your theme. Or have a look into the barceloneta theme, how it is setup there. I think i'll not find time in the next two week to work on that, i guess.

MrTango commented 9 years ago

@davilima6 i think that was just a mistake, i wannted to mention you and something went wrong ;)

davilima6 commented 9 years ago

This might be related to plone/Products.CMFPlone#1181 and plone/Products.CMFPlone#1136.

@fulv, I'm working with registry.xml only and that seems stable (and imo more flexible/desirable for a packaged theme).

MrTango commented 9 years ago

@davilima6

Yes, but this way will not work well by now, because then you need to rebuild the bundles in the registry by hand, after you installed your package/theme.

Yes, of course the registry is usefull it self and special for addon-packages which comes with resources. But i would hide that in the main theme documentation or let's say mention it as a side note, but not force people to dive into to resource registry. Because they will just freak out with all the stuff.

davilima6 commented 9 years ago

@MrTango Np, and if you are short of time please reassign this to me. Let's stop having integrators scratching their heads so much ;)

Re: your last comment I completely agree with both points, that's what I meant with "info box", an <aside>, semantically speaking, or an "admonition note" in docs.plone.org terminology.

davilima6 commented 8 years ago

@MrTango, if you don't mind I'm going to make a PR on this one.

MrTango commented 8 years ago

Go ahead ;)

davilima6 commented 8 years ago

Done! I took the opportunity to update Diazo selectors from XPath to CSS, same as I did here: plone/plonetheme.barceloneta#39. Also fixed a bit which led to duplicated IDs bug, like this: plone/plonetheme.barceloneta#53