Reference assets from your theme

You will notice that Telerik decided to make it a standard for playing template and theme content in the App_Data folder. When accessing assets from your theme or template, you can skip right over the “App_Data” references in your project. The routing in the application knows when “/Sitefinity” is referenced, to start from the App_Data folder.

<script type="text/javascript" src="/Sitefinity/WebsiteTemplates/Custom/JS/global.js"></script>


Remove Ajax Framework by Default

By default – the Ajax Framework is turned on for every page. If you don’t have any controls that require it – then it adds a lot of additional inline source and JavaScript that has no purpose. If you remove it by default and a control requires it – it will still get added to the page!

<asp:ScriptManager ID="scriptManager" runat="server" AjaxFrameworkMode="Disabled"></asp:ScriptManager>


Minimize load times for Sitefinity 4

Sitefinity (and most other .NET apps) are notorious for having a long initial load time. You can increase this time setting inside of your application pool in IIS. Or – you can take the easier route and sign up for a free pingdom.com account. It will hit the site every 5 minutes (variable time) – thus keeping it alive. It also sends automatic downtime reports.

Remove SFREF attribute in Content Modules

If you are using the Fluent API (or regular API) to grab Content from a list, blog post, or any other content module – you may find this helpful. By default, the Content attribute for each of these modules contains the content from the HtmlEditor. If you output this to the page, it will still contain all of the SFREF attributes. In Sitefinity’s native controls – this gets parsed out. Here’s how to do it manually:

string dirty = Telerik.Sitefinity.Web.Utilities.LinkParser.UnresolveLinks(blogPost.Content);
string cleaned = Telerik.Sitefinity.Web.Utilities.LinkParser.ResolveLinks(dirty, Telerik.Sitefinity.Modules.GenericContent.DynamicLinksParser.GetContentUrl,null, false);


In the above example, “blogPost” is the content item. “cleaned” is the resolved content for that item with all of the links rendered correctly.

Frontend Html Editor copies site body style (FIX)

If you use the blog module with comments enabled, you will notice that the textarea for the actual comment is an iFrame. It pulls in the same stylesheet as the site and in doing so the textarea will have the same background and font color as the site itself - typically an undesired effect.

.sfreContentArea { background-color:none; }


This is a unique CSS class that is added within the iFrame – allowing you to style it specifically.