<p>You don't strictly need to change the AMP template for each entry type; you can just load the entry in your AMP template via the slug in the URL.</p>

<p>Check out how I did it here: <a href="https://nystudio107.com/blog/google-amp-should-you-care#implementing-amp-in-craft-cms" rel="nofollow noreferrer">Implementing AMP in Craft CMS</a></p>

CC BY-SA 3.0
2018-02-04T13:11:10.157Z
Your article is awesome and extremely helpful! I can access the entry as you’ve indicated, but I still don’t understand how I can customize the AMP template for the two entry types that are using different templates for the non-AMP pages.
Scott Carr
CC BY-SA 3.0
2018-02-04T13:26:50.740Z
Are you suggesting to use a single _amp_entry.twig file and then use Twig embed or include for the entry type templates?
Scott Carr
CC BY-SA 3.0
2018-02-06T05:23:04.633Z
I'm suggesting you have a single _amp_entry.twig that extends from an _amp_layout.twig, yes. If you have more than one entry type, sure, just include a partial based on the entry type.
andrew.welch
CC BY-SA 3.0
2018-02-04T05:09:49.943Z
2018-02-04T05:09:49.943Z
andrew.welch
<p>I'm stuck on implementing AMP templates with category-based URLs as I can't find a way to route the different entry types in the Routes function in the CP.</p>

<p>I have a channel title Articles that has two entry types (Lists and Articles) with a URL format <code>{businessCategory.first.slug}/{slug}</code> that uses a primary category for the first segment of the URL.</p>

<p>I've tried <code>*/slug/amp</code> as a route in the CP but then I can't change the AMP template for each entry type.</p>

<p>Any help would be greatly appreciated!</p>

<routes>
Setting up routes for AMP template with category-based urls
# Setting up routes for AMP template with category-based urls

(Asked by: username_0 on 2018-02-04)

I'm stuck on implementing AMP templates with category-based URLs as I can't find a way to route the different entry types in the Routes function in the CP.

I have a channel title Articles that has two entry types (Lists and Articles) with a URL format `{businessCategory.first.slug}/{slug}` that uses a primary category for the first segment of the URL.

I've tried `*/slug/amp` as a route in the CP but then I can't change the AMP template for each entry type.

Any help would be greatly appreciated!

**Tags:** routes

---

## 1 answers

### Answer by username_1 on 2018-02-04. Score: 1 | Accepted answer

You don't strictly need to change the AMP template for each entry type; you can just load the entry in your AMP template via the slug in the URL.

Check out how I did it here: [Implementing AMP in Craft CMS](https://nystudio107.com/blog/google-amp-should-you-care#implementing-amp-in-craft-cms)

> **Comments:**
> **username_0**: Your article is awesome and extremely helpful! I can access the entry as you’ve indicated, but I still don’t understand how I can customize the AMP template for the two entry types that are using different templates for the non-AMP pages.  
> **username_0**: Are you suggesting to use a single _amp_entry.twig file and then use Twig embed or include for the entry type templates?  
> **username_1**: I'm suggesting you have a single _amp_entry.twig that extends from an _amp_layout.twig, yes. If you have more than one entry type, sure, just include a partial based on the entry type.  

---

