# إضافة دعم لإعدادات السمة

**URL:** <https://meta.discourse.org/t/add-support-for-theme-settings/78103>\
**Category:** Feature\
**Created:** [15 يناير 2018، 10:32م UTC](https://meta.discourse.org/t/add-support-for-theme-settings/78103 "2018-01-15T22:32:53Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)\
**Post date:** [11 أبريل 2018، 7:27م UTC](https://meta.discourse.org/t/add-support-for-theme-settings/78103/18 "2018-04-11T19:27:05Z")

</div>

> [@Osama](#):
>
> With this change, theme devs will be able to use theme settings in handlebars

It’s not working properly in raw handlebar templates. [Here](https://github.com/discourse/discourse/blob/09c5e1018aba419b10c1123966e6c131efd5b449/app/assets/javascripts/discourse/helpers/theme-setting-injector.es6#L23) incorrect context variable `hash.data.root` is used instead of `hash.hash.context`. But even fixing it not resolving the problem since the context itself carrying incorrect value.

In this [line](https://github.com/discourse/discourse/blob/09c5e1018aba419b10c1123966e6c131efd5b449/app/models/theme_field.rb#L66) instead to set `this` object to `context` variable the [raw handlebar precompiler](https://github.com/discourse/discourse/blob/09c5e1018aba419b10c1123966e6c131efd5b449/app/models/theme_field.rb#L72) setting constant string value `"this"` to the `context` _(`context = "this"`)_. It is working perfectly in normal handlebars since it using [different precompiler](https://github.com/discourse/discourse/blob/09c5e1018aba419b10c1123966e6c131efd5b449/app/models/theme_field.rb#L81).

We have to fix the raw handlebar precompiler to resolve this issue. Until that I did [Remove support for theme settings in raw handlebar templates · discourse/discourse@19e8f9a · GitHub](https://github.com/discourse/discourse/commit/19e8f9af13468080c5e0c2669ee5a2dbef15faee)

---

_[View the full topic](https://meta.discourse.org/t/add-support-for-theme-settings/78103)._
