<p>Might <a href="http://imperavi.com/redactor/docs/settings/formatting/#setting-formattingAdd" rel="nofollow">formattingAdd</a> be something you can use for this? Not tested, just a quick look at Redactor's options page.</p>

<pre><code>formattingAdd: [
    {
        tag: 'code',
        title: 'Code'
    }
]
</code></pre>

CC BY-SA 3.0
2014-10-02T22:48:20.460Z
It did not work when putting it into my Standard.json file. Maybe I'm putting it in the wrong place?
Jeremy Dennis
CC BY-SA 3.0
2014-10-03T08:16:03.613Z
Did you select Standard as the config setting for your field?
Paul
CC BY-SA 3.0
2014-10-03T15:20:46.463Z
Yeah. I know it's using the Standard.json file because I can remove existing tags and they are removed from the drop-down. No worries though. I've settled for using 'pre' and it works fine. Thanks for your help!
Jeremy Dennis
CC BY-SA 3.0
2014-10-05T13:41:57.920Z
This doesn't work because Craft is not yet on Redactor 10.0. Probably just a matter of time though. Nice find, Paul!
carlcs
CC BY-SA 3.0
2014-10-01T07:45:39.203Z
2014-10-01T07:45:39.203Z
Paul
<p>I would like to add the 'code' tag to the formatting drop-down. My rich text field is using Standard.json and I am able to remove the current tags, but it's not letting me add additional tags. I have tried adding 'code' like this in my Standard.json file:</p>

<pre><code>formattingTags: ['p', 'blockquote', 'pre', 'code', 'h1', 'h2' 'h3', 'h4', 'h5']
</code></pre>

<p>Any thoughts?</p>

<p>(I realize 'pre' and 'code' are similar but if possible I would like to use code to be semantic.)</p>

<richtext><drop-down>
How do I add an HTML tag to the formatting drop-down in the rich text editor?
# How do I add an HTML tag to the formatting drop-down in the rich text editor?

(Asked by: username_0 on 2014-09-30)

I would like to add the 'code' tag to the formatting drop-down. My rich text field is using Standard.json and I am able to remove the current tags, but it's not letting me add additional tags. I have tried adding 'code' like this in my Standard.json file:
formattingTags: ['p', 'blockquote', 'pre', 'code', 'h1', 'h2' 'h3', 'h4', 'h5']

Any thoughts?
(I realize 'pre' and 'code' are similar but if possible I would like to use code to be semantic.)

**Tags:** richtext, drop-down


---

## 1 answers

### Answer by username_1 on 2014-10-01. Score: 2

Might formattingAdd be something you can use for this? Not tested, just a quick look at Redactor's options page.
formattingAdd: [
    {
        tag: 'code',
        title: 'Code'
    }
]

> **Comments:**
> **username_0**: It did not work when putting it into my Standard.json file. Maybe I'm putting it in the wrong place?  
> **username_1**: Did you select Standard as the config setting for your field?  
> **username_0**: Yeah. I know it's using the Standard.json file because I can remove existing tags and they are removed from the drop-down. No worries though. I've settled for using 'pre' and it works fine. Thanks for your help!  
> **username_2**: This doesn't work because Craft is not yet on Redactor 10.0. Probably just a matter of time though. Nice find, username_1!  

---

