This is a migrated thread and some comments may be shown as answers.

FormatSets Question

1 Answer 35 Views
This is a migrated thread and some comments may be shown as answers.
Dan Ehrmann
Top achievements
Rank 1
Dan Ehrmann asked on 17 Apr 2012, 11:03 PM
Using the new FormatSets gadget - very nice!

One question - can I change the section titles in the drop down?

For example, rather than "Inline Format Sets", I might like it to say "Inline Styles"

1 Answer, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 20 Apr 2012, 02:54 PM
Hi,

The FormatSets tool still does not offer a localization and the only possible way to rename the strings is by overwriting the JavaScript of the tool. Here is how to do that (see the highlighted lines below):

<telerik:RadEditor ID="RadEditor1" runat="server">
    <Tools>
        <telerik:EditorToolGroup>
            <telerik:EditorTool Name="FormatSets" />
        </telerik:EditorToolGroup>
    </Tools>
    <FormatSets>
        <telerik:EditorFormatSet Tag="H1" Title="<h1 style='color: green'>green header 1</h1>">
            <attributes>
                <telerik:EditorFormatSetAttribute Name="class" Value="greenClass" />
                <telerik:EditorFormatSetAttribute Name="style" Value="color: green;" />
            </attributes>
        </telerik:EditorFormatSet>
        <telerik:EditorFormatSet Tag="img" Title="<span style='border: 1px solid red;'>red border image</span>">
            <attributes>
                <telerik:EditorFormatSetAttribute Name="class" Value="redBorderImage" />
                <telerik:EditorFormatSetAttribute Name="style" Value="border: 1px solid red; margin: 10px;" />
            </attributes>
        </telerik:EditorFormatSet>
        <telerik:EditorFormatSet Tag="li" Title="<ul><li style='list-style-type: square;color: Red;'>square red list</li></ul>">
            <attributes>
                <telerik:EditorFormatSetAttribute Name="style" Value="list-style-type: square;color: red;" />
            </attributes>
        </telerik:EditorFormatSet>
        <telerik:EditorFormatSet Tag="" Title="<span style='color: Magenta'>magenta text</span>">
            <attributes>
                <telerik:EditorFormatSetAttribute Name="style" Value="color: Magenta" />
            </attributes>
        </telerik:EditorFormatSet>
    </FormatSets>
</telerik:RadEditor>
<script type="text/javascript">
    var $ = $telerik.$,
    $T = Telerik.Web.UI;
    $.registerControlProperties($T.Editor.FormatSetsDropDown, {
        clientStateFieldID: null,
        blockSetsText: "Block Styles",
        inlineSetsText: "Inline Styles",
        elementSetsText: "Element Styles",
        blockSets: [],
        inlineSets: [],
        elementSets: [],
        selectedElement: null,
        clientTypeName: "Telerik.Web.UI.Editor.FormatSetsDropDown"
    });
</script>


All the best,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Asked by
Dan Ehrmann
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or