Tel: 0151 223 0001

We believe in three things: users, users, users.

Edit allowed HTML attributes in TinyMCE

Edit allowed HTML attributes in TinyMCE - brought to you by sdesign1 - Umbraco specialists

This article shows you how to edit the configuration for TinyMCE in an Umbraco installation. If you are trying to add specific HTML attributes to elements, but find they are being stripped out, then follow this article to help resolve the issue.

For this article, we'll use an example of putting an "id" on a "span". This should typically look like:

<span id="image">This is an image caption</span>

However, by default, Umbraco will strip this "id" away from the "span" and once you save your page, it will render to:

<span>This is an image caption</span>

To avoid this stripping, we need to edit the TinyMCE configuration file.

You need to connect to your web server with an FTP client, such as Filezilla. Open the "config/tinyMceConfig.config" file in a text editor, such as Notepad or Wordpad.

Scroll to the bottom and find the element you need to change: for example:

 -span[class|align]

And then add in the attribute you wish to be able to add:

 -span[class|align|id]

Save and upload the file. Now log out of Umbraco and restart it.

Potential Issues

If you find the "id" is still being stripped out of your pages. Then you should open your web.config file, go to the bottom and hit the "Return" key on your keyboard (this will force a blank new line in your file). Now Save the file and upload it to your web server. This will force Umbraco into realising that a change has been made to the configuration settings.

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Fill in the blank