More in this section

Forums / Developing with Sitefinity / "Format Code" Sitefinity Control

"Format Code" Sitefinity Control

6 posts, 0 answered
  1. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    12 Nov 2007
    Link to this post
    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
    ==============
  2. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    12 Nov 2007
    Link to this post
    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
  3. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    12 Nov 2007
    Link to this post
    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
  4. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    12 Nov 2007
    Link to this post
    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
    ===================
  5. Rebecca
    Rebecca avatar
    536 posts
    Registered:
    24 Sep 2012
    13 Nov 2007
    Link to this post
    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
  6. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    31 Dec 2008
    Link to this post
    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/
Register for webinar
6 posts, 0 answered