Closed AntonioCS closed 6 years ago
can you please post your sonata_admin:
config?
This is how it looks like in my project (using Sonata Admin 3.30.1) and they are located in the core bundle now:
Ok this is a configuration issue. Here is my config:
sonata_admin:
assets:
javascripts:
- bundles/sonataadmin/vendor/jquery/dist/jquery.min.js
- bundles/sonataadmin/vendor/jquery.scrollTo/jquery.scrollTo.js
- bundles/sonataadmin/vendor/jqueryui/ui/minified/jquery-ui.min.js
- bundles/sonataadmin/vendor/jqueryui/ui/minified/i18n/jquery-ui-i18n.min.js
- bundles/sonatapage/sonata-page.back.min.js
stylesheets:
- bundles/sonataadmin/vendor/AdminLTE/css/font-awesome.min.css
- bundles/sonataadmin/vendor/jqueryui/themes/flick/jquery-ui.min.css
- bundles/sonatapage/sonata-page.back.min.css
I didn't think to look at the config because I just copied everything from the docs and that piece of config is here: https://sonata-project.org/bundles/page/3-x/doc/reference/installation.html
So can someone please take a look at the docs for Sonata page as this is having implications on other sonata bundles.
can you please provide a docs PR? You can finde the file here: https://github.com/sonata-project/SonataPageBundle/blob/3.x/docs/reference/installation.rst
the other files are working fine?
We should probably use there the new feature from admin bundle where you can add custom js css without overriding all files
As soon as I removed that configuration everything started to work.
What am I suppose to do with the documentation? It's my first time using sonata page, how am I suppose to know what should be there instead of this?
Did you removed the whole config part or just this line? And do you still have font awesome icons in your browser?
As is found out it looks like the asset was moved from admin to core bundle, so the path needs to be changed like this:
- bundles/sonataadmin/vendor/AdminLTE/css/font-awesome.min.css
+ bundles/sonatacore/vendor/components-font-awesome/css/font-awesome.min.css
does the config works when you only change this line?
No, I get back the same layout. I have no errors in the Network tab but I see a page without css.
I can leave the javascripts section but I had to remove all of the stylesheets section for the page to work.
I have no errors in the Network tab but I see a page without css.
ok, so you need to put that config back and execute bin/console assets:install
to add the assets for the page bundle, please try this out:
sonata_admin:
assets:
extra_stylesheets:
- bundles/sonatapage/sonata-page.back.min.css
extra_javascripts:
- bundles/sonatapage/sonata-page.back.min.js
the other assets from the docs should be loaded and merged automatically
I did the assets:install and still the page does not load right. Here is what I have now:
sonata_admin:
assets:
javascripts:
- bundles/sonataadmin/vendor/jquery/dist/jquery.min.js
- bundles/sonataadmin/vendor/jquery.scrollTo/jquery.scrollTo.js
- bundles/sonataadmin/vendor/jqueryui/ui/minified/jquery-ui.min.js
- bundles/sonataadmin/vendor/jqueryui/ui/minified/i18n/jquery-ui-i18n.min.js
- bundles/sonatapage/sonata-page.back.min.js
stylesheets:
- bundles/sonatacore/vendor/components-font-awesome/css/font-awesome.min.css
- bundles/sonataadmin/vendor/jqueryui/themes/flick/jquery-ui.min.css
- bundles/sonatapage/sonata-page.back.min.css
extra_stylesheets:
- bundles/sonatapage/sonata-page.back.min.css
extra_javascripts:
- bundles/sonatapage/sonata-page.back.min.js
remove all this:
javascripts:
- bundles/sonataadmin/vendor/jquery/dist/jquery.min.js
- bundles/sonataadmin/vendor/jquery.scrollTo/jquery.scrollTo.js
- bundles/sonataadmin/vendor/jqueryui/ui/minified/jquery-ui.min.js
- bundles/sonataadmin/vendor/jqueryui/ui/minified/i18n/jquery-ui-i18n.min.js
- bundles/sonatapage/sonata-page.back.min.js
stylesheets:
- bundles/sonatacore/vendor/components-font-awesome/css/font-awesome.min.css
- bundles/sonataadmin/vendor/jqueryui/themes/flick/jquery-ui.min.css
- bundles/sonatapage/sonata-page.back.min.css
Yes! That seems to work out great. Now I am seeing the pages page with the proper css being loaded (like in the sonata demo).
Thanks!
Great, can you replace that part of the docs with your part? This is everything you need to do for sonata page 👍
Please don't close this, as we first need to fix the docs
Right, sorry. Fixing the docs will have to be delegated :)
Fixing the docs will have to be delegated :)
what do you mean by that?
Great, can you replace that part of the docs with your part? This is everything you need to do for sonata page 👍
This will have to be delegated to someone.
This will have to be delegated to someone.
Ah that means you won't do it? Or do I missunderstood sth.?
You are correct. I am on my work machine I don't have my github key credentials and now that I have finally fixed this issue I have to make up for the day I lost yesterday trying to fix this.
This could be done via the github.com website and the "edit" button 😆 🤣
Anyway you said "Thanks" at least and this is much more than in your last issue ☝️ 👏
🤦♂️ Done in 1 min https://github.com/sonata-project/SonataPageBundle/pull/939
Great, thank you @silasjoisten 🎉
I didn't know that.
Thought I had to fork, clone to my machine, change, create PR
Thought I had to fork, clone to my machine, change, create PR
Next time you could ask and we are here for helping you out, with your issue, creating PR's and so on, but saying "No" is a bad attitude
Right 👍
Environment
Sonata packages
Symfony packages
PHP version
PHP 5.6.31-pl0-gentoo
Subject
Css for admin page does not load
I have installed sonata and ran
All resources seems to install correctly but when I go to:
I am presented with this:
As you can see from the image all requests load except the one for font-awesome.min.css but the file does not exist anywhere in Sonata.
I also ran
but that didn't fix anything.
What am I missing???
NOTE: In the AdminLTE github project there is no font-awesome.min.css file. You can view the project here: https://github.com/almasaeed2010/AdminLTE/tree/master/dist/css