# Getting template data into map JSON file

**URL:** <https://discourse.mapeditor.org/t/getting-template-data-into-map-json-file/7095>\
**Category:** Questions\
**Created:** [November 20, 2024, 4:29am UTC](https://discourse.mapeditor.org/t/getting-template-data-into-map-json-file/7095 "2024-11-20T04:29:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CptSpaulding](https://avatars.discourse-cdn.com/v4/letter/c/96bed5/32.png) [@CptSpaulding](https://discourse.mapeditor.org/u/CptSpaulding)\
**Post date:** [November 20, 2024, 4:29am UTC](https://discourse.mapeditor.org/t/getting-template-data-into-map-json-file/7095/1 "2024-11-20T04:29:47Z")

</div>

I am exporting my map in JSON file and reading it into my monogame project with a nested class, which is used to render and manipulate the map.

I am now putting some finish touches on, in which I need multiple tiles to act as one object. My method is to create a template that is the size of these multi[le tiles and layer them on top of the stamps on my map, and I set a custom property on the template that is my source rectangle on the sprite sheet. This allows me to render the whole object off the sprite sheet as one texture in my engine.

My current issue is when I export my object layer looks like this:

```json
"objects":[
                {
                 "id":10,
                 "template":"..\/maps\/tree.tx",
                 "x":424.25,
                 "y":40.25
                }, 

```

I see in the documentation it is possible to export the template itself as JSON but cant figure out how to do that. Even better if I can export that JSON into the map JSON itself. Are either of these actions possible?

---

<div class="post-metadata">

**Author:** ![eishiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/eishiya/32/2534_2.png) [@eishiya](https://discourse.mapeditor.org/u/eishiya)\
**Post date:** [November 20, 2024, 4:42am UTC](https://discourse.mapeditor.org/t/getting-template-data-into-map-json-file/7095/2 "2024-11-20T04:42:15Z")

</div>

I don’t work with templates so I don’t know if there’s an easy way to convert a TX template into a TJ template (it’s definitely possible, but it might be rather annoying to replace all the references).

If you want to include the template data directly in your maps, that’s possible: Enable the “Detach templates” export option in Edit \> Preferences. Note that this only applies to _exports_, so your working maps get to keep using templates.

---

<div class="post-metadata">

**Author:** ![CptSpaulding](https://avatars.discourse-cdn.com/v4/letter/c/96bed5/32.png) [@CptSpaulding](https://discourse.mapeditor.org/u/CptSpaulding)\
**Post date:** [November 20, 2024, 10:57am UTC](https://discourse.mapeditor.org/t/getting-template-data-into-map-json-file/7095/3 "2024-11-20T10:57:21Z")

</div>

Great thank you! Looking forward to getting that sorted.
