How To Display Formatted Code Blocks Using Your Sitefinity RadEditors

Craig Holdheide  |  Aug 04, 2014  |  Comments

For all those developers out there that want to display code on their Sitefinity web site, check out the Format Code Block tool for the RadEditor.  This handy tool allows you to easily paste a chunk of code on your site with ease.  

Steps To Enable The Format Code Block Tool

  1. Go to Administration > Settings and then select "Text area" from the menu on the left.
    1. If you have the multi-site module enabled, you will need to click the "Global settings" link after navigating to Administration > Settings.
  2. Click the EDIT button for the "Default tool set".  See the yellow highlighted link below.Text Editor Settings
  3. Insert the following code <tool name="FormatCodeBlock" /> after the "FormatBlock" xml node.  See the XML highlighted in yellow below.Format Code Block XML
  4. Click the SAVE button.

You will now see the following tool added to your RadEditors.  Click this icon to open the format code block editor.

Format Code Block Button

Below is an example of the format code block editor.  Simply paste your code in the text area at the top, select a language, click preview, and then click OK once you are ready to paste the code block.

Format Code Block Editor

 Now you can quickly and easily add formatted code to any of your content in seconds.  Enjoy.

comments powered by Disqus

My Social Channels

Keep Up To Date

What is this?