Answers.Body: <p>Have a look at the <code>folderId</code> parameter. <a href="https://docs.craftcms.com/v3/dev/element-queries/asset-queries.html#parameters" rel="nofollow noreferrer">https://docs.craftcms.com/v3/dev/element-queries/asset-queries.html#parameters</a></p>
  
  <p>To find which id your folder has, it looks like you have to look in the <code>assets</code> table - someone might have an easier solution.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-21T23:48:52.650Z
Answers.Text: Yeah, I looked at the folderId parameter, but to get that to work with what I'm doing I'd have to do some finagling.  I did something similar with jQuery.
Answers.UserDisplayName: JJefferyDev
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-21T09:12:27.053Z
Answers.LastActivityDate: 2020-01-21T09:12:27.053Z
Answers.UserDisplayName: Seb
Body: <p>I am having trouble referencing specific subfolders in Assets in Craft 3 using Twig.  The query that I've written is still showing all content, when I only want it to show content from a specific subfolder. </p>
  
  <p>The folder layout: /files/asset-volume/subfolder/file.txt</p>
  
  <p>When I try this query code, I still get all of the files from the volume, when I only want the subfolder.  How do I only reference the specific subfolder?</p>
  
  <pre><code>{% set subFolders = craft.assets()
                      .volume('asset-volume')
                      .includeSubfolders('subfolder')
                      .all()
  %}
  </code></pre>
  
Tags: <templating><craft3><assets>
Title: How to reference specific asset subfolders in Craft 3
ThreadText: # How to reference specific asset subfolders in Craft 3
  
  (Asked by: username_0 on 2020-01-20)
  
  I am having trouble referencing specific subfolders in Assets in Craft 3 using Twig. The query that I've written is still showing all content, when I only want it to show content from a specific subfolder.
  
  The folder layout: /files/asset-volume/subfolder/file.txt
  
  When I try this query code, I still get all of the files from the volume, when I only want the subfolder. How do I only reference the specific subfolder?
  
  ```
  {% set subFolders = craft.assets()
                      .volume('asset-volume')
                      .includeSubfolders('subfolder')
                      .all()
  %}
  
  ```
  
  **Tags:** templating, craft3, assets
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-01-21. Score: 1
  
  Have a look at the `folderId` parameter. <https://docs.craftcms.com/v3/dev/element-queries/asset-queries.html#parameters>
  
  To find which id your folder has, it looks like you have to look in the `assets` table - someone might have an easier solution.
  
  > **Comments:**
  > **username_0**: Yeah, I looked at the folderId parameter, but to get that to work with what I'm doing I'd have to do some finagling.  I did something similar with jQuery.  
  
  ---
  
  