More in this section
Categories
Bloggers
Blogs RSS feed

Forcing authors to use your predefined CSS classes to style their content in Sitefinity 5

by Grigori Karanikolov

Coming from this blog post, I wanted to highlight the way the Sitefinity team made it easier to change the configuration of the WYSIWYG editor that is used in various places throughout the CMS.
You don’t even have to enter the “Advanced” section of the administration of Sitefinity, as I described in the blog post above. Now, you can simply go to Administration->Settings and open the Text Editor section to customize the default toolset, used through all the backend of Sitefinity:
image

You are able to edit the tools that show up in your editor’s toolbox right inside Sitefinity now. And of course, if you want to have separate configurations for the editors inside different modules of Sitefinity, you are absolutely able to achieve that by setting different toolbox configuration files in the options for each module.

  • As explained in the aforementioned blog post, this is extremely useful if you’d like to customize the number of tools content authors will have access to. This way you can enforce consistency for the content all over your website by enforcing authors to use only your CSS styles to format their content and removing tools that allow adding custom inline CSS.
    There are just 3 things you need to do:
    Edit the tool set and remove any tools you wouldn’t want to appear in there;
  • Add the ApplyClass tool, which would provide a dropdown with your own classes. Add it by simply including this: <tool name=”ApplyClass”/> between the <tools></tools> tags in the toolset configuration.
  • Specify which CSS files the ApplyClass should use and map which classes from these files it should be able to apply:

image

Save and you’re done!
Remember to clean your browser cache, so that the all the CSS files are refreshed! Otherwise you’ll end up with an empty ApplyClass dropdown menu.

image

Comments and thoughts are welcome!

44 comments

Leave a comment
  1. Michael Apr 13, 2012
    Thank you, this works. But now my editor is picking up my overall page background image within the editor.  This makes editing very difficult as the body has a very dark blue background and the text is a dark color.  How do you make the editor ignore the body's background?
  2. Grisha 'Greg' Karanikolov Apr 17, 2012
    Michael, have you created a separate CSS file for your RadEditor classes? I would recommend that you put the classes you need to use within RadEditor in a separate CSS file for easier management and to avoid such hurdles.
    Did this help?
  3. Martin Sahuc Jun 19, 2012
    Did someone know how to specify the css tu use in admin's preview pages ?
    Because styles are not applied in that case.
  4. Nancy Rackleff Jun 21, 2012
    This works fine for me up until the point that I add the "classes". If I add the apply class tool and the css file, it works fine, but displays everything in that file. So, I attempt to add the classes in order to narrow it down then it reverts back to nothing but the clear class. Here is my classes declaration:
    <classes>
        <class name="Green Button" value=".btn-grn"/>
        <class name="Blue Button" value=".btn-blu"/>
    </classes>
    Any idea what might be causing this? I don't want to have to duplicate all of the classes I need in a different file. I would like to be able to use the full file and just narrow it down with the class list.
  5. Nancy Rackleff Jun 21, 2012
    This works fine for me up until the point that I add the "classes". If I add the apply class tool and the css file, it works fine, but displays everything in that file. So, I attempt to add the classes in order to narrow it down then it reverts back to nothing but the clear class. Here is my classes declaration:
    <classes>
        <class name="Green Button" value=".btn-grn"/>
        <class name="Blue Button" value=".btn-blu"/>
    </classes>
    Any idea what might be causing this? I don't want to have to duplicate all of the classes I need in a different file. I would like to be able to use the full file and just narrow it down with the class list.
  6. Nancy Rackleff Jun 21, 2012
    Sorry about the double post there. Also, I forgot to mention that I am using Sitefinity 5.
  7. Nancy Rackleff Jun 21, 2012
    I think I've got this figured out....sort of. I read on http://www.telerik.com/help/aspnet-ajax/editor-css-styles.html "Please, note that if you have css classes defined with the following syntax: .Emphasis, p em{color: #A4CE3A; font-style: normal; } then the editor will parse and read only the .Emphasis class and will populate the "Apply Class" dropdown only with this class. If RadEditor starts to parse the strings after the comma, this will drastically decrease the editor performance and it will be loaded slower on the page."
    My blue and green button classes are part of a comma separated list of classes, so that could be part of it. Also, the classes in question appear in multiple declarations, so it may have just not been able to grasp them.
    I think I will end up creating a simplified stylesheet to use in the editor. It will probably be the easiest in the long run. I can simplify it by not including the hover or visited states for links and things like that.
  8. seogroup Nov 01, 2017
    A debt of gratitude is in order for sharing the post.. folks are universes best individual in every existences of individual..they need or must succeed to manage needs of the crew.  mink lash
  9. smith Nov 02, 2017
    I think this is a really good article.  You make this information interesting and engaging.  You give readers a lot to think about and I appreciate that kind of writing. mydownloadtube
  10. sonia Nov 03, 2017
    This web journal is so decent to me. I will continue coming here over and over. Visit my connection too..  gamer home
  11. seogroup Nov 03, 2017
    i was simply scanning along and happened upon your site. simply needed to say great site and this article truly helped me.  SNZ HB 167-2006
  12. Robinjack Nov 05, 2017
    I'm glad I found this web site, I couldn't find any knowledge on this matter prior to.Also operate a site and if you are ever interested in doing some visitor writing for me if possible feel free to let me know, im always look for people to check out my web site. escorts lebanon
  13. seogroup Nov 05, 2017
    Incredible data! I as of late went over your online journal and have been perusing along. I thought I would leave my first remark. I don't realize what to say with the exception of that I have.  lice eggs
  14. sonia Nov 06, 2017
    I have been looking at a couple of your stories and i can state really well done. I will bookmark your website  industrial stickers
  15. seogroup Nov 09, 2017
    This is a savvy blog. I would not joke about this. You have such a great amount of learning about this issue, thus much enthusiasm. You additionally know how to make individuals rally behind it, clearly from the reactions.  showbox online
  16. Robinjack Nov 09, 2017
    Thank you for very usefull information.. beirut escort
  17. seo Nov 10, 2017
    Doubtlessly this is an amazing post I got a great deal of learning in the wake of perusing good fortunes. Topic of online journal is phenomenal there is very nearly everything to peruse, Brilliant post.  https://cinemabox.club/mobdro-apk/
  18. jk Nov 11, 2017
    With the addition of wild yam root as an factor, the supplement provides the potential to push your exercises to the restrict and past. trenorol
  19. seo Nov 13, 2017
    Much obliged to you for extremely usefull data..  Kadıköy Nakliyat
  20. Robinjack Nov 14, 2017
    You have done a great job on this article.  It’s very readable and highly intelligent.  You have even managed to make it understandable and easy to read.  You have some real writing talent. Thank you. Fennel Essential Oil
  21. Olivia Nov 16, 2017
    I respect this article for the all around looked into substance and magnificent wording. I got so included in this material that I couldn't quit perusing. I am awed with your work and ability. Much thanks to you to such an extent. Hair transplant
  22. robinjack Nov 18, 2017
    Your online journal furnished us with profitable data to work with. Each and every tips of your post are great. Much obliged for sharing. Continue blogging,  casinodunya
  23. Robinjack Nov 18, 2017
    The post is composed in exceptionally a decent way and it contains numerous valuable data for me. Hero Instinct
  24. Robinjack Nov 18, 2017
    Simply a grinning visitant here to share the affection (:, btw remarkable  iddaa siteleri
  25. amelia Nov 19, 2017
    Whether you already have a financial advisor or are now looking to hire one, you want someone who has your best financial interest at heart. Comprehensive financial planning for an individual or couple generally involves tax planning, risk management, investment planning, retirement planning and gift and estate planning. We help clients create a financial plan that aligns with their life goals and we can help you too. port arthur wealth management
  26. robinjack Nov 19, 2017
    This is extremely instructive substance and composed well for a change. It's pleasant to see that a few individuals still see how to compose a quality post!  mobil bahis
  27. robinjack Nov 22, 2017
    I can set up my new thought from this post. It gives top to bottom data. A debt of gratitude is in order for this significant data for all,..  canli blackjack
  28. Robinjack Nov 22, 2017
    I truly welcome this superb post that you have accommodated us. I guarantee this would be advantageous for a large portion of the general population.  casino milyon
  29. jk Nov 23, 2017
    Our Overwatch boosting and training squad includes some of proficient excessive professional players that could reach the peak spots of the competitive ladder quite simply. if you search for in-intensity sport know-how honestly ebook an Overwatch education session with one of the masters of the sport. overwatch boosting
  30. Robinjack Nov 23, 2017
    I truly thank you for the important information on this extraordinary subject and anticipate more awesome posts. Much obliged for appreciating this excellence article with me. I am welcoming it all that much! Anticipating another awesome article. Good fortunes to the creator! All the best!  His Secret Obsession
  31. seo Nov 23, 2017
    You have done a amazing job with you website. house for rent in Long Bien district
  32. Robinjack Nov 27, 2017
    I read that Post and got it fine and educational. It would be ideal if you share more like that...  boutique florida pr firm
  33. hac Nov 28, 2017
    They are always seeking to cheer you up and give you hope despite the odds. Tap into them as a resource for good vibes. T2Online
  34. amelia Nov 28, 2017
    Get bulk SMS in Nigeria @ 76kobo per unit of SMS & enjoy immediate delivery. We provide fastest,affordable & most reliable bulk SMS in Nigeria. SMS in Nigeria
  35. Robinjack Nov 30, 2017
    Decent Informative Blog having pleasant sharing..  Natural Food
  36. Robinjack Nov 30, 2017
    Standart bahis seçeneklerinin yani sira artik canli bahis konusunda kazanç saglamak için siteler arasinda büyük bir rekabet söz konusudur. Bu durum elbette en çok kullanicilara yansimaktadir. Çünkü yüksek bahis oranlari sunan bahis siteleri her zaman popülerdir. En iyi canli bahis siteleri hakkinda arastirma yaparken dikkat etmeniz gereken kriterler de bulunur. Elbette ilk olarak lisansli olmasi gerekir. Ardindan, sitede sunulan bahis seçeneklerinin çok olmasinda fayda var. Alternatifli bahis siteleri bu yüzden daima tercih edilmektedir. Sitemizde yapacaginiz arastirmalarin ardindan bu sitelere ulasabilir ve tercihlerinizi çok daha uygun bir sekilde yapabilirsiniz. Canli bahis
  37. amelia Dec 01, 2017
    Great data on your website, thank you for setting aside an ideal opportunity to impart to us. Stunning knowledge you have on this present, it's pleasant to discover a site that points of interest such a great amount of data about distinctive specialists.  magie voyance
  38. jk Dec 03, 2017
    These are some awesome instruments that i certainly use for SEO work. This is an extraordinary rundown to use later on..  Bus Charter Cologne
  39. Robinjack Dec 03, 2017
    An entrancing dialog is quality remark. I surmise that it is best to compose additional on this matter, it won't be an unthinkable point however for the most part individuals are insufficient to chat on such themes. To the following. Salud  esta usa
  40. robinjack Dec 03, 2017
    This is an awesome moving article.I am essentially satisfied with your great work.You put truly extremely accommodating data. Keep it up. Continue blogging. Hoping to perusing your next post.  cuccia grande per giardino riscaldata con i cuscini
  41. Robinjack Dec 06, 2017
    Amazing, this is truly fascinating perusing. I am happy I discovered this and got the opportunity to peruse it. Awesome employment on this substance. I like it.  1xbet
  42. SEO Dec 09, 2017
    A debt of gratitude is in order for setting aside an ideal opportunity to examine this, I feel unequivocally about it and adoration adapting more on this point. In the event that conceivable, as you pick up aptitude, would you psyche upgrading your online journal with additional data? It is to a great degree supportive for me.  Air Conditioner
  43. robinjack Dec 10, 2017
    Extremely intriguing web journal. Alot of web journals I see nowadays don't generally give anything that I'm keen on, however I'm most definately intrigued by this one. Recently imagined that I would post and let you know.  kaliteli casino
  44. hac Dec 10, 2017
    Recent times when net has so often gossip mongering and clog; your proportion really refreshes me. Wine Cooler

    Leave a comment