<p>Is <code>asset()</code> a Twig <a href="http://twig.sensiolabs.org/doc/2.x/tags/macro.html" rel="nofollow noreferrer">macro</a> you've defined?</p>

<p>Are you sure you're just not looking for the global <a href="https://craftcms.com/docs/templating/functions#url" rel="nofollow noreferrer"><code>url()</code></a> method instead?</p>

CC BY-SA 3.0
2017-01-25T20:28:30.177Z
2017-01-25T20:28:30.177Z
Brad Bell
<p>I am working on a project and the plug in I installed won't work because I don't know how to add the jquery.css file needed. </p>

<p>What I did is to add the file with a <code>&lt;link&gt;</code> command but it's still not working.</p>

<p>Any help would be great. </p>

<pre><code>    {% block body %}
&lt;link type="text/css"  href="{{ asset('home/workspace/fermate/src/CtrlBln/HomepageBundle/Resources/public/js/Minimal-jQuery-Image-Viewer-with-Image-Preloading-ABigImage/bigimage.jquery.css')}}" &gt; 
&lt;div class="page-sidebar"&gt;
    {% for link in entity.getSidebarImages() %}
        {% if link.image.isFoto() %}            
            &lt;a href="{{ app.request.basepath }}/{{ link.image.getWebPath() }}"&gt;         
                &lt;img src="{{ app.request.basepath }}/{{ link.image.getWebPath("thumbnail_250") }}" alt="{{ link.image.title }}"&gt;                        
                &lt;div class="sidebar-description"&gt;
                    {{ link.image.description|raw }}
                &lt;/div&gt;  
            &lt;/a&gt;        
        {% else %}
            &lt;div class="sidebar-item sidebar-link-item"&gt;
                &lt;a href="{{ app.request.basepath }}/{{ link.image.webpath }}"&gt;

                 &lt;img src="{{ app.request.basepath }}/{{ link.image.getPreview() }}" /&gt;
                &lt;/a&gt;
                &lt;div class="sidebar-title"&gt;
                    &lt;a href="{{ app.request.basepath }}/{{ link.image.webpath }}"&gt;
                      {{ link.image.title|raw }}
                    &lt;/a&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        {% endif %}
    {% endfor %}    
&lt;script&gt;
$(function(){
    $(this).abigimage();
});   
&lt;/script&gt;
&lt;/div&gt;
{% endblock %}

    {% block body_javascripts %}
        {% javascripts output='aBigImage.js'
        '@CtrlBlnHomepageBundle/Resources/public/js/Minimal-jQuery-Image-Viewer-with-Image-Preloading-ABigImage/abigimage.jquery.min.js'    
        %}
        &lt;script type="text/javascript" src="{{ asset_url }}"&gt;&lt;/script&gt;
        {% endjavascripts %}
    {% endblock %}
</code></pre>

<templating><css>
How to add jquery.css file in Twig?
# How to add jquery.css file in Twig?

(Asked by: username_0 on 2017-01-25)

I am working on a project and the plug in I installed won't work because I don't know how to add the jquery.css file needed. 
What I did is to add the file with a  command but it's still not working.
Any help would be great. 
    {% block body %}
 

    {% for link in entity.getSidebarImages() %}
        {% if link.image.isFoto() %}            
                     
                                        
                
                    {{ link.image.description|raw }}
                  
                    
        {% else %}
            
                

                 
                
                
                    
                      {{ link.image.title|raw }}
                    
                
            
        {% endif %}
    {% endfor %}    


{% endblock %}

    {% block body_javascripts %}
        {% javascripts output='aBigImage.js'
        '@CtrlBlnHomepageBundle/Resources/public/js/Minimal-jQuery-Image-Viewer-with-Image-Preloading-ABigImage/abigimage.jquery.min.js'    
        %}
        
        {% endjavascripts %}
    {% endblock %}

**Tags:** templating, css


---

## 1 answers

### Answer by username_1 on 2017-01-25. Score: 1

Is `asset()` a Twig [macro](http://twig.sensiolabs.org/doc/2.x/tags/macro.html) you've defined?

Are you sure you're just not looking for the global [`url()`](https://craftcms.com/docs/templating/functions#url) method instead?


---

