Skip to content

CKEditor Template Tokens

Roman M. Yagodin edited this page Mar 2, 2018 · 7 revisions

CKEditor Template Tokens

R7.UserHtml supports CKEditor template tokens via DNN Tokens API.

The [CKEditor:TemplateName] tokens will be replaced with the content of the corresponding template from CKEditor XML template file, which can be specified in module settings.

The CKEditor template tokens can be placed in the content for empty and default HTML in the module settings.

Nested templates

Each referenced template could also contain [CKEditor:TemplateName] tokens, which will be replaced with referenced template content. Currently only two template levels are supported: root template and its direct children.

If you want to preserve common tokens such as [User:DisplayName] until final replace, you should escape them with the [Final][/Final] quotes, so [User:DisplayName] will become [Final]User:DisplayName[/Final].

Example

<?xml version="1.0" encoding="utf-8" ?>
<Templates imagesBasePath="/DotNetNuke/Portals/0/images" templateName="default">
    <Template title="Timed List Item">
        <Description>Template for list item with current date (child template).</Description>
        <Html>
        <![CDATA[
            <li>[Final]DateTime:Now[/Final] - List Item</li>
        ]]>
        </Html>
    </Template>
    <Template title="Unordered List">
        <Description>Template for the unordered list (root template).</Description>
	<Html>
            <![CDATA[
                <ul>
                    [CKEditor:Timed List Item]
                    [CKEditor:Timed List Item]
                </ul>
            ]]>
         </Html>
     </Template>
</Templates>