Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SDL Tridion 2011: Rich Text Editor Configuration to produce specific markup

I have a requirement to produce mark up like the following for an image within the SDL Tridion Rich text editor:

<div class="imagemasksmall">
   <img src="tcm:2-123-16" alt="My amazing image" />
</div>

My initial thought was to use the FormatAreaStyles.css file to add a class like div.imagemasksmall { }, however this only seems to be available if I add the div in the mark up.

Is there a way to allow an editor to produce the above markup without having to write the code manually?

like image 474
Rob Stevenson-Leggett Avatar asked Jan 08 '13 09:01

Rob Stevenson-Leggett


1 Answers

If all you need is a DIV with the "imagemasksmall" class and an image inside, you can do that in 3 steps (as you have already added the style to FormatAreaStyles.css):

  1. Insert the image
  2. Change the Section Type drop-down to "Generic container (div)"
  3. Change the Style drop-down to "imagemasksmall"

If you want to reduce the number of manual steps needed for it, you will probably have to write an extension that does those steps for the user.

like image 126
Peter Kjaer Avatar answered Oct 27 '22 00:10

Peter Kjaer