<p>None of the <a href="http://imperavi.com/redactor/docs/settings/" rel="nofollow">settings you can put in your Redactor config-file</a> will do what you want. You <strong>can</strong> write a <a href="http://imperavi.com/redactor/docs/plugins-creating/" rel="nofollow">redactor plugin</a> to do this, and then include your redactor plugin as a Craft plugin. One Craft plugin that does this is <a href="https://github.com/pixelandtonic/RedactorClips/" rel="nofollow">RedactorClips</a>.</p>

<p>If your Craft plugin is <em>mycraftplugin</em>, and your redactor plugin files are <em>myredactorplugin.css</em> and <em>myredactorplugin.js</em>, then you store the redactor plugin files in the <code>resources</code> directory of your craft plugin, and in the craft plugin <code>init()</code> function, you call:</p>

<pre><code>craft()-&gt;templates-&gt;includeCssResource('mycraftplugin/myredactorplugin.css');
craft()-&gt;templates-&gt;includeJsResource('mycraftplugin/myredactorplugin.js');
</code></pre>

CC BY-SA 3.0
2014-07-19T17:49:08.280Z
2014-07-19T17:49:08.280Z
Marion Newlevant
<p>If I add an image to a rich-text field, I can set it's title. On the front-end however, the img-tag only gets an alt-attribute. I would also like the title-attribute to be set. Is this possible with a Redactor config-file, and if so, how?</p>

<redactor>
Can I make Redactor add a 'title' attribute to img-tag?
# Can I make Redactor add a 'title' attribute to img-tag?

(Asked by: username_0 on 2014-07-18)

If I add an image to a rich-text field, I can set it's title. On the front-end however, the img-tag only gets an alt-attribute. I would also like the title-attribute to be set. Is this possible with a Redactor config-file, and if so, how?

**Tags:** redactor

---

## 1 answers

### Answer by username_1 on 2014-07-19. Score: 3

None of the settings you can put in your Redactor config-file will do what you want. You can write a redactor plugin to do this, and then include your redactor plugin as a Craft plugin. One Craft plugin that does this is RedactorClips.
If your Craft plugin is mycraftplugin, and your redactor plugin files are myredactorplugin.css and myredactorplugin.js, then you store the redactor plugin files in the resources directory of your craft plugin, and in the craft plugin init() function, you call:
craft()->templates->includeCssResource('mycraftplugin/myredactorplugin.css');
craft()->templates->includeJsResource('mycraftplugin/myredactorplugin.js');


---

