Answers.Body: <p>What you want is <a href="http://buildwithcraft.com/docs/templating/craft.assets" rel="nofollow">craft.assets</a></p>
  
  <blockquote>
    <p>You can access your site’s assets from your templates via craft.assets. It returns an ElementCriteriaModel object.</p>
  </blockquote>
  
  <p>Use <code>sourceId</code> for the parameter.</p>
  
  <p>To find the sourceId, look at the <code>craft_assetsources</code> table in the database. There doesn't seem to be any way to query for <a href="http://buildwithcraft.com/docs/templating/assetsourcemodel" rel="nofollow">AssetSourceModel</a>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-21T12:05:04.667Z
Answers.Text: Yes I saw this. It's pretty cryptic though, how do I find the sourceId?
Answers.UserDisplayName: hamishtaplin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-22T08:20:44.807Z
Answers.Text: Thanks, this works. Not a very intuitive solution though, I would hope there is a better way than having to look up id's in the database!
Answers.UserDisplayName: hamishtaplin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-19T16:40:18.153Z
Answers.LastActivityDate: 2014-09-21T17:21:11.600Z
Answers.LastEditDate: 2014-09-21T17:21:11.600Z
Answers.UserDisplayName: Marion Newlevant
Answers.Body: <p>You can fetch assets related to a certain source by using the <a href="https://craftcms.com/docs/templating/craft.assets#source" rel="nofollow noreferrer">craft.assets.source</a> method and passing in the source handle. </p>
  
  <p>Assuming your handle is 'my_images', the following will do the job:</p>
  
  <pre><code>craft.assets.source('my_images')
  </code></pre>
  
  <p>You avoid having to lookup db IDs that way.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-05T09:07:31.230Z
Answers.Text: Note: If you want to pull _all_ Assets, be sure to set the `limit` parameter to `null`, i.e. `{% set assets = craft.assets.source('my_images').limit(null) %}`, otherwise your query will be limited to 100 Assets.
Answers.UserDisplayName: Mats Mikkel Rummelhoff
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-05T03:44:38.820Z
Answers.LastActivityDate: 2017-12-05T03:44:38.820Z
Answers.UserDisplayName: zumek
Body: <p>I have a bunch of images that aren't related to any entries but are in an asset source. Let's call this 'My Images'.</p>
  
  <p>How do I just grab those assets? I can't find anything in the docs that suggests this is possible—it seems such an obvious use-case though I'm sure I am missing something.</p>
  
Tags: <assets>
Title: Get assets from an asset source
ThreadText: # Get assets from an asset source
  
  (Asked by: username_0 on 2014-09-19)
  
  I have a bunch of images that aren't related to any entries but are in an asset source. Let's call this 'My Images'.
  
  How do I just grab those assets? I can't find anything in the docs that suggests this is possible—it seems such an obvious use-case though I'm sure I am missing something.
  
  **Tags:** assets
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2014-09-19. Score: 4
  
  What you want is [craft.assets](http://buildwithcraft.com/docs/templating/craft.assets)
  
  > You can access your site’s assets from your templates via craft.assets. It returns an ElementCriteriaModel object.
  
  Use `sourceId` for the parameter.
  
  To find the sourceId, look at the `craft_assetsources` table in the database. There doesn't seem to be any way to query for [AssetSourceModel](http://buildwithcraft.com/docs/templating/assetsourcemodel).
  
  > **Comments:**
  > **username_0**: Yes I saw this. It's pretty cryptic though, how do I find the sourceId?  
  > **username_0**: Thanks, this works. Not a very intuitive solution though, I would hope there is a better way than having to look up id's in the database!  
  
  ---
  
  ### Answer by username_2 on 2017-12-05. Score: 3
  
  You can fetch assets related to a certain source by using the [craft.assets.source](https://craftcms.com/docs/templating/craft.assets#source) method and passing in the source handle.
  
  Assuming your handle is 'my\_images', the following will do the job:
  
  ```
  craft.assets.source('my_images')
  
  ```
  
  You avoid having to lookup db IDs that way.
  
  > **Comments:**
  > **username_3**: Note: If you want to pull _all_ Assets, be sure to set the `limit` parameter to `null`, i.e. `{% set assets = craft.assets.source('my_images').limit(null) %}`, otherwise your query will be limited to 100 Assets.  
  
  ---
  
  