# How to switch template for a document

**URL:** <https://community.bloomreach.com/t/how-to-switch-template-for-a-document/1805>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [March 17, 2020, 4:01pm UTC](https://community.bloomreach.com/t/how-to-switch-template-for-a-document/1805 "2020-03-17T16:01:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/thomas/32/753_2.png) [@Thomas](https://community.bloomreach.com/u/Thomas)\
**Post date:** [March 17, 2020, 4:01pm UTC](https://community.bloomreach.com/t/how-to-switch-template-for-a-document/1805/1 "2020-03-17T16:01:09Z")

</div>

I know how to switch the template for a component in cms !  
But is there also a solution for switching the template for a document in cms.

Assume I have 2 documents matching the same sitemap item (any-matcher), is there a way to change the template inside cms for one of them (like for components).

My use case is, that I render a table of content for longer articles and I do not want to put to much logic into a single template and also avoid to spend an extra sitemap-item (e.g hardcode some pages) .

Thx in advance

---

<div class="post-metadata">

**Author:** ![Lef\_Karamoulas](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/lef_karamoulas/32/82_2.png) [@Lef\_Karamoulas](https://community.bloomreach.com/u/Lef_Karamoulas)\
**Post date:** [March 17, 2020, 4:17pm UTC](https://community.bloomreach.com/t/how-to-switch-template-for-a-document/1805/2 "2020-03-17T16:17:50Z")

</div>

Hello Thomas,

if I understand your requirement correctly this [page](https://documentation.bloomreach.com/library/concepts/hst-configuration-model/advanced/multiple-page-mappings-in-single-sitemap-item.html) explains how to map different page configuration from a single sitemap item based on document types.

**Note that this requires your documents to be of different type.**

HTH and kind regards,  
Lef

---

<div class="post-metadata">

**Author:** ![Thomas](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/thomas/32/753_2.png) [@Thomas](https://community.bloomreach.com/u/Thomas)\
**Post date:** [March 17, 2020, 4:20pm UTC](https://community.bloomreach.com/t/how-to-switch-template-for-a-document/1805/3 "2020-03-17T16:20:57Z")

</div>

Sounds like a plan - thanks
