<main>
  <section>
    <h1>Noneditable Plugin: Letters Example</h1>
    <p>This is an example of the <a href="https://www.tiny.cloud/docs/plugins/noneditable/" target="_blank">noneditable</a>
      plugin in TinyMCE 5 combined with the <a href="https://www.tiny.cloud/docs/plugins/template/" target="_blank">template</a>
      to demonstrate how parts of templates can be made noneditable.</p>
    <textarea></textarea>
    <p>For this example, the template source is within the TinyMCE init configuration. This will make it easier to
      play with the example. In a real-world use case, you may like to use <a href="https://www.tiny.cloud/docs/plugins/template/#templates" class="_blank">externally hosted templates</a>.</p>
  </section>
</main>
body {
  margin: 2rem 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial,
    sans-serif;
}

main {
  max-width: 720px;
  margin: auto;
}

section {
  margin-bottom: 3rem;
}

h1 {
  font-size: 1.75rem;
  font-weight: bold;
}

a {
  color: rgb(25, 118, 210);
  font-weight: bold;
  text-decoration: none;
}

a:hover {
  color: rgb(145, 180, 225);
}
tinymce.init({
  selector: "textarea",
  plugins: "noneditable template code",
  toolbar: "template code",
  menubar: false,

  min_height: 380,
  templates: [
    {
      title: "Letter Example: Approve Change",
      description: "An example letter to approve a requested change.",
      content:
        "<p>Thank you for your change request.</p>" +
        "<p>We are happy to inform you that your request has been fully approved.</p>" +
        '<p class="is-locked">Please note that this change may take up to 24 hours to appear on your account.</p>'
    },
    {
      title: "Letter Example: Reject Change",
      description:
        "An example letter to inform of a rejected requested change.",
      content:
        "<p>Thank you for your change request.</p>" +
        "<p>Unfortunately at this time, we cannot approve this request.</p>" +
        '<p class="is-locked">Please contact the customer care team for further assistance.</p>' +
        "<p>You can create a new change request if you would like to apply again.</p>"
    }
  ],

  noneditable_noneditable_class: "is-locked"
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdn.tiny.cloud/1/qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc/tinymce/5/tinymce.min.js