Link Classes

Some sites have styles that allow links with certain classes to appear as a button rather than a generic text link. Instead of manually editing the source in the editor to add a class, TinyMCE lets us create a dropdown list of available link styles that will apply classes automatically.

To give admins the ability to choose classes on a link, the site will need a "tinymce_link_classes.txt" file. Here's an example that shows "None" as an option, "Blue Button" as an option, and "Red Button" as an option, though there can be as many options as needed:

[
{title: 'None', value: ''},
{title: 'Blue Button', value: 'btn blue'},
{title: 'Red Button', value: 'btn red'}
]

Save this as "/files/tinymce_link_classes.txt" and the content editor will enable the dropdown on its own.

 

Image Classes

Some sites have styles that allow images with certain classes to appear in unique ways. Instead of manually editing the source in the editor to add a class, TinyMCE lets us create a dropdown list of available image styles that will apply classes automatically.

To give admins the ability to choose classes on a image, the site will need a "tinymce_image_classes.txt" file. Here's an example that shows "None" as an option, and "Background" as an option, though there can be as many options as needed:

[
{title: 'None', value: '},
{title: 'Background', value: 'bg'}
]

Save this as "/files/tinymce_image_classes.txt" and the content editor will enable the dropdown on its own.