简体   繁体   中英

Sonata Admin v 3.4.0 fontawesome icons missing on list/edit pages

I have a problem with icons not showing up when creating/editing/listing. On dashboard everything is ok. I have checked their demo and there are fine but the same font errors occurs. When changing page, ex. edit, the url for font awesome changes and also the version, i didn't found where. I added fontawesome to web/fonts folders and this is why is ok in dashboard. Why is the font url changing with page and where is the versions 4.2 coming from?

font awesome error

assetic:
debug:          '%kernel.debug%'
use_controller: '%kernel.debug%'
filters:
    cssrewrite: ~
assets:
    sonata_admin_css:
         %kernel.root_dir%/../web/bundles/sonatacore/vendor/components-font-awesome/css/font-awesome.css
    sonata_front_css:
         %kernel.root_dir%/../web/bundles/sonatacore/vendor/components-font-awesome/css/font-awesome.css 

FontAwesome can be found in the SonataCoreBundle . You should include the css (in your assetic config). Below is an example which also uses the page bundle for sonata_front_css.

# app/config/assetic.yml
assetic:
    assets:
        # ...
        sonata_admin_css:
            # ...
            - %kernel.root_dir%/../web/bundles/sonatacore/vendor/components-font-awesome/css/font-awesome.css
        # ...
        sonata_front_css:
            # ...
            - %kernel.root_dir%/../web/bundles/sonatacore/vendor/components-font-awesome/css/font-awesome.css

Then copy the font into the web/fonts directory (any best practise, someone?)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM