New Creator

WYSIWYG - WordPasteOptions

Could I get an example on how to use this ? I don't see any on the API documentation.

0 Kudos
2 Replies
Crownpeak Employee

You can customize the Wysiwyg input experience with the following 'WysiwygParams'  code which provides a <Paste as Text> on/off Icon and until you turn it off all html, excel and word copy/pastes will paste as text.    The example below gives example of some of the parameters available to customize the Wysiwyg.

i.e. When using this code and you copy from word, excel or html  and paste using ctrl-v you get a pop up window asking if you want to remove formatting or not.    ( the actual editing icons don't work - i get an error))

<%@ Page Language="C#" Inherits="CrownPeak.Internal.Debug.InputInit" %>
<%@ Import Namespace="CrownPeak.CMSAPI" %>
<%@ Import Namespace="CrownPeak.CMSAPI.Services" %>
<%@ Import Namespace="CrownPeak.CMSAPI.CustomLibrary" %>

    WysiwygParams wParams = ServicesInput.FullWYSIWYG();
    wParams.Stylesheet = "/Lance Beehler/_Assets/css/style.css";     ! your css reference goes here
    wParams.ImageFolder = "/";
    wParams.ImageUpload = RelationshipType.Attach;
    wParams.ImageBrowse = RelationshipType.Link;
    wParams.LinkFolder = "/";
    wParams.LinkUpload = RelationshipType.Attach;
    wParams.LinkBrowse = RelationshipType.Link;
    wParams.DesignEditTabs = true;
    wParams.AddListGroup( FeatureType.None );  //none is used to prevent separator from appearing after group
    Input.ShowWysiwyg("devbody", "dev_body_field", wParams, width: 950, height: 200);




I believe

Input.ShowWysiwyg("targeting", "targeting", ServicesInput.MediumWYSIWYG());

also provides the same <Paste as Text> capability

0 Kudos