# How to apply JSON (content representations)?

**URL:** <https://forum.getkirby.com/t/how-to-apply-json-content-representations/15309>\
**Category:** Questions\
**Tags:** v3\
**Created:** [August 19, 2019, 10:01am UTC](https://forum.getkirby.com/t/how-to-apply-json-content-representations/15309 "2019-08-19T10:01:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolcoolhomebody](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@coolcoolhomebody](https://forum.getkirby.com/u/coolcoolhomebody)\
**Post date:** [August 19, 2019, 10:01am UTC](https://forum.getkirby.com/t/how-to-apply-json-content-representations/15309/1 "2019-08-19T10:01:25Z")

</div>

I’m creating a json file with reference to the **‘content representations’** guide.  
But I don’t know how to apply this.

I have a template _/site/templates/bookshops.php_  
and I created _site/templates/bookshops.json.php_

Then when I connect to bookshops.json, I can connect.  
But how can I represent this like bookshops.php?  
Currently these two files look different.  
[https://seoulbookshops.kr/bookshops](https://seoulbookshops.kr/bookshops)  
[https://seoulbookshops.kr/bookshops.json](https://seoulbookshops.kr/bookshops.json)

The reason I want to make json is because I want to use ajax later.  
The story related to this is in the question I posted before.  
[https://forum.getkirby.com/t/how-to-use-ajax-in-kirby3/15300](https://forum.getkirby.com/t/how-to-use-ajax-in-kirby3/15300)

And I read this guide.  
[https://getkirby.com/docs/guide/templates/content-representations](https://getkirby.com/docs/guide/templates/content-representations)

 ![25](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/d/d3578a011cd9df13a0b482e19dde0e743978250a.png)

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [August 19, 2019, 10:18am UTC](https://forum.getkirby.com/t/how-to-apply-json-content-representations/15309/2 "2019-08-19T10:18:26Z")

</div>

I don’t really understand the question. If I got right what you said before, there is not need for the `bookshops.php` standard template but a snippet that is loaded when the page is first loaded, because you want to pull your content via Ajax into the homepage. For that you need an Ajax call to the content representation when the user clicks on “Bookshops” and you need content representations for the stuff you want insert when the user clicks a link.

In fact, it would make sense to reuse the initial snippet in your content representation to prevent duplicating your code.

Could you please clarify or be more specific what information is missing? Thank you.

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [August 19, 2019, 6:32pm UTC](https://forum.getkirby.com/t/how-to-apply-json-content-representations/15309/3 "2019-08-19T18:32:56Z")

</div>

Continued here, so closing this: [How to use AJAX in kirby3](https://forum.getkirby.com/t/how-to-use-ajax-in-kirby3/15300/14)

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [August 19, 2019, 6:33pm UTC](https://forum.getkirby.com/t/how-to-apply-json-content-representations/15309/4 "2019-08-19T18:33:51Z")

</div>


