Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
davilima6 opened this issue Nov 10, 2015 · 12 comments · Fixed by #177
Closed

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

davilima6 opened this issue Nov 10, 2015 · 12 comments · Fixed by #177

Comments

@davilima6
Copy link
Member

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
Copy link
Member Author

/cc @pbauer @fulv @MrTango

@MrTango
Copy link
Contributor

MrTango commented Nov 10, 2015

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
Copy link
Member Author

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:

  • Avoid delivering the extra diazo bundle by registering your theme's (or generic addon) resources into the plone or plone-legacy bundles.
  • Being able to deliver some bundle on some views only
  • ... ?

@fulv
Copy link
Member

fulv commented Nov 10, 2015

@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
Copy link
Contributor

MrTango commented Nov 10, 2015

@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
Copy link
Contributor

MrTango commented Nov 10, 2015

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

@MrTango MrTango assigned MrTango and unassigned davilima6 Nov 10, 2015
@davilima6
Copy link
Member Author

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
Copy link
Contributor

MrTango commented Nov 10, 2015

@davilima6

  • Avoid delivering the extra diazo bundle by registering your theme's (or generic addon) resources into the plone or plone-legacy bundles.

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.

  • Being able to deliver some bundle on some views only

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
Copy link
Member Author

@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
Copy link
Member Author

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

@MrTango MrTango assigned davilima6 and unassigned MrTango Nov 23, 2015
@MrTango
Copy link
Contributor

MrTango commented Nov 23, 2015

Go ahead ;)

@davilima6
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants