Answers.Body: <p>Could you add your own field to use as a slug?</p>
  
  <p>When you edit an Asset Source in Settings you get the <code>Field Layout</code> tab same as you do for Entries. You could maybe add something there and then combine this with a <a href="http://buildwithcraft.com/docs/routing#advanced-routing" rel="nofollow">Route</a> somehow?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-05T15:54:25.937Z
Answers.Text: That was my backup plan, but it doesn't do the initial auto completion of the field that the slug field does which I like!
Answers.UserDisplayName: Andy Harris
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-05T23:02:24.403Z
Answers.Text: @AndyHarris You could use the [`onSaveAsset`](http://buildwithcraft.com/docs/plugins/events-reference#assets-onSaveAsset) event, and do the auto-completion yourself.
Answers.UserDisplayName: Victor
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-06T09:23:53.167Z
Answers.Text: @AndyHarris - Further to Victor's suggestion, if you take a look in `craft/app/helpers/ElementHelper.php`, there is a static method called `createSlug` which does all the hard work for you.
Answers.UserDisplayName: Steve Holland
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-06T10:12:59.090Z
Answers.Text: OK thanks chaps, I'll check that out - however, the slug I'm getting back must be coming from somewhere so I'm still keen to know if we can access that!
Answers.UserDisplayName: Andy Harris
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-05T15:10:50.887Z
Answers.LastActivityDate: 2014-08-05T15:10:50.887Z
Answers.UserDisplayName: Steve Holland
Body: <p>I'm trying to create a site with a gallery, and am investigating the possibility of getting Craft to treat an asset as an entry so I can display a detail page for an image without having to create an entry for it specifically.</p>
  
  <p>I think it might do what I need, but I've fallen at the first hurdle whereby according to the documentation (unless I've missed it) assets don't have a slug. I could use ID, but the client will want keywords in the URL blah blah.</p>
  
  <p>If I pull an asset and output {{ asset.slug }}, it does return what I'd want it to. The problem is, if I edit the title, that value isn't updated and there doesn't appear to be a way to get to it.</p>
  
  <p>Is it possible to get to this somehow?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-08-05T12:10:17.583Z
Comments.Text: What happens if you change the filename instead of the title? Maybe `asset.slug` == filename?
Comments.UserDisplayName: carlcs
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-08-05T12:48:28.943Z
Comments.Text: It's definitely coming from the title as the filenames are totally different.
Comments.UserDisplayName: Andy Harris
Tags: <assets><assetfilemodel>
Title: Is there a 'slug' for assets?
ThreadText: # Is there a 'slug' for assets?
  
  (Asked by: username_0 on 2014-08-05)
  
  I'm trying to create a site with a gallery, and am investigating the possibility of getting Craft to treat an asset as an entry so I can display a detail page for an image without having to create an entry for it specifically.
  
  I think it might do what I need, but I've fallen at the first hurdle whereby according to the documentation (unless I've missed it) assets don't have a slug. I could use ID, but the client will want keywords in the URL blah blah.
  
  If I pull an asset and output {{ asset.slug }}, it does return what I'd want it to. The problem is, if I edit the title, that value isn't updated and there doesn't appear to be a way to get to it.
  
  Is it possible to get to this somehow?
  
  **Tags:** assets, assetfilemodel
  
  > **Comments:**
  > **username_1**: What happens if you change the filename instead of the title? Maybe `asset.slug` == filename?  
  > **username_0**: It's definitely coming from the title as the filenames are totally different.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2014-08-05. Score: 4
  
  Could you add your own field to use as a slug?
  
  When you edit an Asset Source in Settings you get the `Field Layout` tab same as you do for Entries. You could maybe add something there and then combine this with a [Route](http://buildwithcraft.com/docs/routing#advanced-routing) somehow?
  
  > **Comments:**
  > **username_0**: That was my backup plan, but it doesn't do the initial auto completion of the field that the slug field does which I like!  
  > **username_3**: @username_0 You could use the [`onSaveAsset`](http://buildwithcraft.com/docs/plugins/events-reference#assets-onSaveAsset) event, and do the auto-completion yourself.  
  > **username_2**: @username_0 - Further to username_3's suggestion, if you take a look in `craft/app/helpers/ElementHelper.php`, there is a static method called `createSlug` which does all the hard work for you.  
  > **username_0**: OK thanks chaps, I'll check that out - however, the slug I'm getting back must be coming from somewhere so I'm still keen to know if we can access that!  
  
  ---
  
  