Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-25T20:28:30.177Z
Answers.LastActivityDate: 2017-01-25T20:28:30.177Z
Answers.UserDisplayName: Brad Bell
Body: <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>
  
Tags: <templating><css>
Title: How to add jquery.css file in Twig?
ThreadText: # 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 `<link>` command but it's still not working.
  
  Any help would be great.
  
  ```
      {% block body %}
  <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')}}" > 
  <div class="page-sidebar">
      {% for link in entity.getSidebarImages() %}
          {% if link.image.isFoto() %}            
              <a href="{{ app.request.basepath }}/{{ link.image.getWebPath() }}">         
                  <img src="{{ app.request.basepath }}/{{ link.image.getWebPath("thumbnail_250") }}" alt="{{ link.image.title }}">                        
                  <div class="sidebar-description">
                      {{ link.image.description|raw }}
                  </div>  
              </a>        
          {% else %}
              <div class="sidebar-item sidebar-link-item">
                  <a href="{{ app.request.basepath }}/{{ link.image.webpath }}">
  
                   <img src="{{ app.request.basepath }}/{{ link.image.getPreview() }}" />
                  </a>
                  <div class="sidebar-title">
                      <a href="{{ app.request.basepath }}/{{ link.image.webpath }}">
                        {{ link.image.title|raw }}
                      </a>
                  </div>
              </div>
          {% endif %}
      {% endfor %}    
  <script>
  $(function(){
      $(this).abigimage();
  });   
  </script>
  </div>
  {% endblock %}
  
      {% block body_javascripts %}
          {% javascripts output='aBigImage.js'
          '@CtrlBlnHomepageBundle/Resources/public/js/Minimal-jQuery-Image-Viewer-with-Image-Preloading-ABigImage/abigimage.jquery.min.js'    
          %}
          <script type="text/javascript" src="{{ asset_url }}"></script>
          {% 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?
  
  
  ---
  
  