Is there anyway to add a HTML class to an image when adding it to the RTE? When using the image picker, it let's us choose an image, but I'd like a way for authors to be able to choose a class for that image, which would determine how it displays on the front end of the site.
For example, pick an image, then select either "Full width, Left align, Right align" etc and that would apply a class of, for example, "right-align" to the image in the HTML code.
Thanks for your response, I hadn't noticed the Alignment buttons worked on images! That does just float the images though, so I'm more interested in the second option - you mentioned you could add classes to images, how does this work (other than editing the source code)?
Image in RTE, choose a class/Alignment
Hello!
Is there anyway to add a HTML class to an image when adding it to the RTE? When using the image picker, it let's us choose an image, but I'd like a way for authors to be able to choose a class for that image, which would determine how it displays on the front end of the site.
For example, pick an image, then select either "Full width, Left align, Right align" etc and that would apply a class of, for example, "right-align" to the image in the HTML code.
Any idea's how I can achieve this?
Many thanks
Hi Carl,
It's common task in content editing, and Umbraco makes it easy.
There few ways to do that :
1) RTE has 3 buttons om the navigation panel 'Align left', 'Align center' and 'Align right'.
2) Add custom css classes and then add them to images.
3) Open source code of RTE field and edit it as you want )
THanks, Alex
Hi Alex,
Thanks for your response, I hadn't noticed the Alignment buttons worked on images! That does just float the images though, so I'm more interested in the second option - you mentioned you could add classes to images, how does this work (other than editing the source code)?
Many thanks
Carl
Hi Carl,
You can read great article about that :
http://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/stylesheets-and-javascript/setting-up-rte-styles/documentation
Thanks, Alex
Thanks Alex,
Appreciate your help :-)
Carl
is working on a reply...