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

Image background with css rewrite #15

Closed
ardianys opened this issue Sep 10, 2012 · 6 comments
Closed

Image background with css rewrite #15

ardianys opened this issue Sep 10, 2012 · 6 comments

Comments

@ardianys
Copy link

@ardianys ardianys commented Sep 10, 2012

Hi,
thanks for this great bundle,

I see in your docs

The most easies ways is to copy the glyphicons-halflings.png to your public img folder

cp /your/path/to/bootstrap/img/glyphicons-halflings.png to /path/to/your/bundle/Resources/public/img/

But, could you specify which bundle I have to copy into ?

I see your demo site, but you'r self use base64 in your demo site css.

Regards.

@phiamo
Copy link
Owner

@phiamo phiamo commented Sep 10, 2012

into the bundle where you reference to bootstrap.less or css in your html
the base64 is generated by cssembed plugin of assetic

@ardianys
Copy link
Author

@ardianys ardianys commented Sep 10, 2012

Thanks for your quick response,

I have check your answer,

but my generated css doesn't same with another my symfony app,
it's my generated css in my new app with your bundle

background-image: url("../../Resources/public/img/glyphicons-halflings.png");

and it's my usual generated css

background: url("../../bundles/jariffproject/img/show.png") no-repeat scroll left center transparent;

and it's my assetic config

# Assetic Configuration
assetic:
    debug:          %kernel.debug%
    use_controller: false
    bundles:        [ "MopaBootstrapBundle"]
    #java: /usr/bin/java
    filters:
        cssrewrite: ~
        #closure:
        #    jar: %kernel.root_dir%/Resources/java/compiler.jar
        #yui_css:
        #    jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar
        less:
            node: /usr/local/bin/node
            node_paths: [/usr/local/lib/node_modules]
            apply_to: "\.less$"

and it's my base.twig.html

      {% stylesheets
          '@MopaBootstrapBundle/Resources/public/less/mopabootstrapbundle.less'
          '@JariffProjectBundle/Resources/public/css/style.css'
          filter='cssrewrite'
      %}
        <link href="{{ asset_url }}" type="text/css" rel="stylesheet" media="screen" />
      {% endstylesheets %}

Thanks for your answer. Regards.

@ardianys
Copy link
Author

@ardianys ardianys commented Sep 10, 2012

Sorry,
Ok finally I got it,
But I have to made this directory in my app

../symfony2.1/web/Resources/public/img/glyphicons-halflings.png

not in some bundle which load the css.

But, maybe do you have another standard solution ?

Thanks.

@phiamo
Copy link
Owner

@phiamo phiamo commented Sep 10, 2012

no there is no standard solution.
sorry the prob for this files is some things about assetic and path
resolution in some cases.

@csalazart
Copy link

@csalazart csalazart commented Jun 19, 2014

Yes There Are One Solution..
is Implemente output Filter
{% stylesheets filter='cssrewrite' output='css/compiled/style.css'
Thats Mean the ../../ and Extra Directory is created and the Second sub up Directory is correcty set
So This is a very elegant and nice easy solution...

@haghighisina
Copy link

@haghighisina haghighisina commented Jan 13, 2020

hello gus ,

does eny bodu know how to set up a pic on background in symfony 5

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

No branches or pull requests

4 participants