Answers.Body: <p>You can set the URL format to something like this and it should work:</p>
  
  <pre><code>{% if object.type == "image" %}image/{customFieldHandle}{% elseif object.type == "articles" %}articles/{slug}{% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-22T01:42:16.023Z
Answers.Text: Nice! Would you mind marking it as the answer?
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-22T03:04:42.973Z
Answers.Text: duh, always forget that.. marked ;)
Answers.UserDisplayName: rey
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-22T00:37:21.250Z
Answers.LastActivityDate: 2014-09-22T00:37:21.250Z
Answers.UserDisplayName: Brad Bell
Answers.Body: <p>You can't create a separate url format for each type, the url format is defined on a per section basis. But you can use the type as part of the url, if that helps. For instance, you can set the url format to <code>{type.handle}/{slug}</code>. On a recent project I had an <code>article</code> section with entry types like <code>news</code>, <code>video</code>, <code>story</code>, etc. The resulting url structure was <code>/news/slug</code>, <code>/video/slug</code>, <code>/story/slug</code>, etc.</p>
  
  <p>Also, there is nothing stopping you from defining your url structure using routes, and creating the url's based on whatever variables, including entry type. But it would require some more work since you'd have to make sure all your links conform to your defined routes instead of the actual entry urls. </p>
  
  <p>If you provide more info on what you're trying to achieve, maybe I can provide a more concrete solution.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-20T20:03:40.970Z
Answers.Text: Hi Andre, I  just edited my question with more info, thanks!
Answers.UserDisplayName: rey
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-20T19:07:15.540Z
Answers.LastActivityDate: 2014-09-20T19:07:15.540Z
Answers.UserDisplayName: André Elvan
Body: <p>Is there any way to set a different url format for each entry type of a section?</p>
  
  <p>I have an entry type "image" on which I will be using the <a href="https://github.com/sjelfull/Craft-Randomm" rel="nofollow">Randomm</a> plugin by Fred Carlsen to generate random strings for the URLs. Something like mysite.com/image/324739483. So I have to set the URL format to image/{customFieldHandle}.</p>
  
  <p>But I also have an entry type "articles" and I'd like to add the actual article name in the URL, like mysite.com/articles/some-article-name.</p>
  
Tags: <url><entry-type>
Title: How to set a different URL format for each entry type of a section?
ThreadText: # How to set a different URL format for each entry type of a section?
  
  (Asked by: username_0 on 2014-09-20)
  
  Is there any way to set a different url format for each entry type of a section?
  
  I have an entry type "image" on which I will be using the [Randomm](https://github.com/sjelfull/Craft-Randomm) plugin by Fred Carlsen to generate random strings for the URLs. Something like mysite.com/image/324739483. So I have to set the URL format to image/{customFieldHandle}.
  
  But I also have an entry type "articles" and I'd like to add the actual article name in the URL, like mysite.com/articles/some-article-name.
  
  **Tags:** url, entry-type
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2014-09-22. Score: 3 | Accepted answer
  
  You can set the URL format to something like this and it should work:
  
  ```
  {% if object.type == "image" %}image/{customFieldHandle}{% elseif object.type == "articles" %}articles/{slug}{% endif %}
  
  ```
  
  > **Comments:**
  > **username_1**: Nice! Would you mind marking it as the answer?  
  > **username_0**: duh, always forget that.. marked ;)  
  
  ---
  
  ### Answer by username_2 on 2014-09-20. Score: 2
  
  You can't create a separate url format for each type, the url format is defined on a per section basis. But you can use the type as part of the url, if that helps. For instance, you can set the url format to `{type.handle}/{slug}`. On a recent project I had an `article` section with entry types like `news`, `video`, `story`, etc. The resulting url structure was `/news/slug`, `/video/slug`, `/story/slug`, etc.
  
  Also, there is nothing stopping you from defining your url structure using routes, and creating the url's based on whatever variables, including entry type. But it would require some more work since you'd have to make sure all your links conform to your defined routes instead of the actual entry urls.
  
  If you provide more info on what you're trying to achieve, maybe I can provide a more concrete solution.
  
  > **Comments:**
  > **username_0**: Hi Andre, I  just edited my question with more info, thanks!  
  
  ---
  
  