# Header/footer conflicting with JSON

**URL:** <https://discourse.slimframework.com/t/header-footer-conflicting-with-json/962>\
**Category:** Questions\
**Created:** [November 29, 2016, 5:22pm UTC](https://discourse.slimframework.com/t/header-footer-conflicting-with-json/962 "2016-11-29T17:22:16Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![tflight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/tflight/32/1205_2.png) [@tflight](https://discourse.slimframework.com/u/tflight)\
**Post date:** [November 29, 2016, 5:54pm UTC](https://discourse.slimframework.com/t/header-footer-conflicting-with-json/962/2 "2016-11-29T17:54:18Z")

</div>

Similar to the other [thread about Middleware](http://discourse.slimframework.com/t/logged-in-pages-vs-non-logged-in-pages/961/2?u=tflight), you could use the same approach. You could create a Middleware that sets the header and footer, then apply that Middleware to routes that need it, and don’t apply it to any routes that don’t need it.

---

_[View the full topic](https://discourse.slimframework.com/t/header-footer-conflicting-with-json/962)._
