3

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?

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');
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.