# How to pass a component setting as a value to an attribute?

**URL:** https://meta.discourse.org/t/how-to-pass-a-component-setting-as-a-value-to-an-attribute/264463
**Category:** Development
**Created:** [May 9, 2023, 9:46pm UTC](https://meta.discourse.org/t/how-to-pass-a-component-setting-as-a-value-to-an-attribute/264463 "2023-05-09T21:46:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![gormus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gormus/32/428592_2.png) [@gormus](https://meta.discourse.org/u/gormus)
#### Post date: [May 9, 2023, 9:46pm UTC](https://meta.discourse.org/t/how-to-pass-a-component-setting-as-a-value-to-an-attribute/264463/1 "2023-05-09T21:46:06Z")

</div>

Hi, I’m simply trying to add an external script library via a `<script src="..."></script>` tag in the `head_tag.html` template like this, clearly not the correct syntax.

```html
<script type="text/discourse-plugin" version="1.6.0">

  <script src="https://example.com/library.js"
        charset="UTF-8"
        data-lib-xyz=`${ settings.data_lib_xyz }`
        />

</script>

```

And I get an error, as soon as I enable it:

> SyntaxError: /discourse/theme-8/initializers/theme-field-54-common-html-script-1: Support for the experimental syntax ‘jsx’ isn’t currently enabled (14:3):

What would be the Discourse way of using a theme setting value for a `SCRIPT` tag’s attribute value?

---

<div class="post-metadata">

### Author: ![MarkDoerr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markdoerr/32/549630_2.png) [@MarkDoerr](https://meta.discourse.org/u/MarkDoerr)
#### Post date: [May 9, 2023, 9:58pm UTC](https://meta.discourse.org/t/how-to-pass-a-component-setting-as-a-value-to-an-attribute/264463/2 "2023-05-09T21:58:57Z")

</div>

Hi Osman,

This might be the best place to start: [Theme Developer Quick Reference Guide](https://meta.discourse.org/t/theme-developer-quick-reference-guide/110448).

There’s also a great deal of info on the pluginAPI here: [Developing Discourse Themes & Theme Components](https://meta.discourse.org/t/beginners-guide-to-developing-discourse-themes/93648), including code demos.

You’ll also want to look at our CSP documentation if you’re adding scripts, so that they’ll be allowed to run: [Mitigate XSS Attacks with Content Security Policy](https://meta.discourse.org/t/mitigate-xss-attacks-with-content-security-policy/104243).

I hope that helps, but as always, feel free to send through additional questions.

Mark
