how to applying custom styles to format block in sitefinity

Posted by Community Admin on 03-Aug-2018 11:35

how to applying custom styles to format block in sitefinity 4.o ?

All Replies

Posted by Community Admin on 06-Dec-2010 00:00

hi,

how to  applying custom styles to format block in sitefinity 4.o ?

i am using sitefinity 4.0 rc

in sitefinity 3.7 we simply change in EditorToolsFile.xml file. but how can we do in sitefinity 4.o ?

i will saw the following link
www.sitefinity.com/.../add-custom-css-classes-to-radeditor-for-content-block.aspx

i did according to above link instruction. but i t was not working.below is the my code .please correct me where was i wrong .

class ContentBlockCustom

using System.Web;
using Telerik.Sitefinity.Modules.GenericContent.Web.UI;
using Telerik.Sitefinity.Web.UI.ControlDesign;
 
/// <summary>
/// Summary description for ContentBlockCustom
/// </summary>
 
[ControlDesigner(typeof(ContentBlockDesignerCustom))]
public class ContentBlockCustom:ContentBlock
 
    protected override string LayoutTemplateName
    
        get
        
            return "~/controls/MyConetBlock/MyContentBlock.ascx";
        
    
 
 

DesignerDesigner
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Telerik.Sitefinity.Modules.GenericContent.Web.UI;
 
/// <summary>
/// Summary description for ContentBlockDesignerCustom
/// </summary>
public class ContentBlockDesignerCustom : ContentBlockDesigner
 
    protected override string LayoutTemplateName
    
        get
        
            return "~/controls/MyConetBlock/MyContentBlock.ascx";
        
    
 

and my controller
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MyContentBlock.ascx.cs" Inherits="controls_MyConetBlock_MyContentBlock" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.Fields" TagPrefix="sf" %>
 
  
<asp:Literal ID="contentHtml" runat="server"></asp:Literal>
 
 
<sf:ResourceLinks id="resourcesLinks" runat="server">
  
    <sf:ResourceFile Name="~/App_Data/Sitefinity/WebsiteTemplates/YourTemplate/App_Themes/YourTheme/Black Yellow/EditorStyleCss/editor_styles.css" />
  
</sf:ResourceLinks>
  
   
  
<sf:FormManager ID="formManager" runat="server" />
  
<div style="width: 660px; overflow: hidden;">
  
    <sf:HtmlField
  
        ID="htmlEditor"
  
        runat="server"
  
        Width="99%"
  
        Height="370px"
  
        EditorContentFilters="DefaultFilters"
  
        EditorStripFormattingOptions="MSWord,Css,Font,Span,ConvertWordLists"
  
        DisplayMode="Write">
  
    </sf:HtmlField>
  
</div>
  
<script type="text/javascript">
 
    $("body").addClass("sfContentBlockDesigner");
  
</script>

Posted by Community Admin on 06-Dec-2010 00:00

Hello Björn,

You can map the template of the GontentBlock designer from Sitefinity's configuration ( take a look at attached screenshot) and then set the property of theHtmlField control.

Kind regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed