Forums

Skip Navigation LinksHome / Developer Network / Forums / Sitefinity 3.x: Developing with Sitefinity > "Format Code" Sitefinity Control

"Format Code" Sitefinity Control

  • Posted on Nov 12, 2007 (permalink)

    I wanted to create a Sitefinity control that allowed me to easily post nicely formatted code samples to GoonDocks.com.  It is now completed and can be viewed here:

    http://goondocks.com/projects/goondocks-sitefinity-controls/sitefinity_format_code_control.aspx

    And downloaded from here:

    http://goondocks.com/projects/goondocks-sitefinity-controls.aspx

    I doubt too many people will have a use for this control.  However some might find it a decent example for creating a Control Designer.

    Comments & criticisms are genuinely welcomed!

    Gabe
    ==============

    Reply

  • bnye Master avatar

    Posted on Nov 12, 2007 (permalink)

    I didn't get a chance to take a good look at it, but what is the differnce between yours and the built in FormatCodeBlock? Activated by adding the following property to the ~/Sitefinity/Admin/ControlTemplates/EditorToolsFile.xml.

    <tool name="FormatCodeBlock" enabled="true"/> 

    Sincerely,

    Ben

    Reply

  • bnye Master avatar

    Posted on Nov 12, 2007 (permalink)

    Gabe -

    I really appreciate your hard work in trying to better the SF community. Hopefully you will inspire others to post code and tips as well.

    Sincerely,

    Ben

    Reply

  • Posted on Nov 12, 2007 (permalink)

    Well, that's a handy feature.  I guess that's what I get for not RTFM.    :)   I don't really know why I didn't consider this....

    For my next trick I'm going to invent the wheel!

    There are some differences though; the RadEditor feature you describe produces the HTML that then gets stored in the DB.  My control actually stores the native code (without markup).  The HTML formatting is produced when the page renders.

    Which means my method is actually more CPU expensive because it requires the CPU to process and render the HTML each time the page loads.  I guess what I'm trying to say is that my method has absolutely no merit what so ever.  :)

    Ben you are now no longer my friend.  Make me look stupid....  How dare you.  

    :)   I'm just joking around.  Thanks for pointing out the obvious.   /sigh

    Gabe
    ===================

    Reply

  • Rebecca Rebecca admin's avatar

    Posted on Nov 13, 2007 (permalink)

    Hi Gabe,

    Thanks for providing your code. Your involvement is highly appreciated.
    Your Telerik account has been updated.

    Sincerely yours,
    Rebecca
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

    Reply

  • Posted on Dec 31, 2008 (permalink)

    This is a very old thread, but I have continued to look for a comfortable solution to posting code samples on my Sitefinity blog.

    Related to this task, I recently published the following article:

    Blogging about your Code - Syntax Highlighting

    Feedback is always welcome!

    Gabe Sumner
    http://www.sitefinitywatch.com/

    Reply

  • Register for webinar
Skip Navigation LinksHome / Developer Network / Forums / Sitefinity 3.x: Developing with Sitefinity > "Format Code" Sitefinity Control