{"id":68,"date":"2024-03-13T17:47:49","date_gmt":"2024-03-13T17:47:49","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/drupalista\/?p=68"},"modified":"2024-03-13T17:47:51","modified_gmt":"2024-03-13T17:47:51","slug":"switching-to-source-code-bug-in-ckeditor","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/drupalista\/2024\/03\/13\/switching-to-source-code-bug-in-ckeditor\/","title":{"rendered":"Switching to Source Code Bug in CKEditor"},"content":{"rendered":"\n<p>In the <a href=\"https:\/\/ckeditor.com\/\">CKEditor<\/a> (this is the box you type in to add content to your website), you have the option to switch to the source code. This view will show you the HTML of your content. I use the source code view to troubleshoot unexpected layout or add classes to HTML elements.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"580\" height=\"380\" src=\"https:\/\/i0.wp.com\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6653\/files\/2024\/03\/image-2.png?resize=580%2C380&#038;ssl=1\" alt=\"screenshot of Drupal interface with the Source button highlighted in CKEditor\" class=\"wp-image-102\" srcset=\"https:\/\/i0.wp.com\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6653\/files\/2024\/03\/image-2.png?w=715&amp;ssl=1 715w, https:\/\/i0.wp.com\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6653\/files\/2024\/03\/image-2.png?resize=300%2C197&amp;ssl=1 300w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/figure>\n\n\n\n<p>However, there is an issue with switching to this view. If you switch to the source code, make any changes, and then scroll down and hit <strong>Update<\/strong>, you will lose all of your changes.<\/p>\n\n\n\n<p><strong>You must switch back to the preview view to keep your changes.<\/strong> You do this by clicking on the Source button again. Then you can click <strong>Update <\/strong>to save your block in Layout Builder. Or if you&#8217;re working in the body of a page, click <strong>Save<\/strong>.<\/p>\n\n\n\n<p>If you really want to dig into this problem, there is a <a href=\"https:\/\/github.com\/ckeditor\/ckeditor5\/issues\/11008\">GitHub issue<\/a>. I&#8217;m not sure if this issue will continue when we update to CKEditor 5, but I hope that fixes it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the CKEditor (this is the box you type in to add content to your website), you have the option to switch to the source code. This view will show you the HTML of your content. I use the source code view to troubleshoot unexpected layout or add classes to HTML elements. However, there is [&hellip;]<\/p>\n","protected":false},"author":8564,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-68","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Switching to Source Code Bug in CKEditor &#8211; Drupalista<\/title>\n<meta name=\"description\" content=\"With CKEditor Source code mode in Drupal, you can lose changes. Switching back to the preview mode ensures all your changes stick.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blogs.oregonstate.edu\/drupalista\/2024\/03\/13\/switching-to-source-code-bug-in-ckeditor\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Switching to Source Code Bug in CKEditor &#8211; Drupalista\" \/>\n<meta property=\"og:description\" content=\"With CKEditor Source code mode in Drupal, you can lose changes. Switching back to the preview mode ensures all your changes stick.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blogs.oregonstate.edu\/drupalista\/2024\/03\/13\/switching-to-source-code-bug-in-ckeditor\/\" \/>\n<meta property=\"og:site_name\" content=\"Drupalista\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-13T17:47:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-13T17:47:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6653\/files\/2024\/03\/image-2.png\" \/>\n<meta name=\"author\" content=\"Kelly Holcomb\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kelly Holcomb\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/2024\\\/03\\\/13\\\/switching-to-source-code-bug-in-ckeditor\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/2024\\\/03\\\/13\\\/switching-to-source-code-bug-in-ckeditor\\\/\"},\"author\":{\"name\":\"Kelly Holcomb\",\"@id\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/#\\\/schema\\\/person\\\/8088d250fb2e8241cfdacfea532d66da\"},\"headline\":\"Switching to Source Code Bug in CKEditor\",\"datePublished\":\"2024-03-13T17:47:49+00:00\",\"dateModified\":\"2024-03-13T17:47:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/2024\\\/03\\\/13\\\/switching-to-source-code-bug-in-ckeditor\\\/\"},\"wordCount\":174,\"publisher\":{\"@id\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/#\\\/schema\\\/person\\\/8088d250fb2e8241cfdacfea532d66da\"},\"image\":{\"@id\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/2024\\\/03\\\/13\\\/switching-to-source-code-bug-in-ckeditor\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/osu-wams-blogs-uploads.s3.amazonaws.com\\\/blogs.dir\\\/6653\\\/files\\\/2024\\\/03\\\/image-2.png\",\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/2024\\\/03\\\/13\\\/switching-to-source-code-bug-in-ckeditor\\\/\",\"url\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/2024\\\/03\\\/13\\\/switching-to-source-code-bug-in-ckeditor\\\/\",\"name\":\"Switching to Source Code Bug in CKEditor &#8211; Drupalista\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/2024\\\/03\\\/13\\\/switching-to-source-code-bug-in-ckeditor\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/2024\\\/03\\\/13\\\/switching-to-source-code-bug-in-ckeditor\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/osu-wams-blogs-uploads.s3.amazonaws.com\\\/blogs.dir\\\/6653\\\/files\\\/2024\\\/03\\\/image-2.png\",\"datePublished\":\"2024-03-13T17:47:49+00:00\",\"dateModified\":\"2024-03-13T17:47:51+00:00\",\"description\":\"With CKEditor Source code mode in Drupal, you can lose changes. Switching back to the preview mode ensures all your changes stick.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/2024\\\/03\\\/13\\\/switching-to-source-code-bug-in-ckeditor\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/2024\\\/03\\\/13\\\/switching-to-source-code-bug-in-ckeditor\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/2024\\\/03\\\/13\\\/switching-to-source-code-bug-in-ckeditor\\\/#primaryimage\",\"url\":\"https:\\\/\\\/osu-wams-blogs-uploads.s3.amazonaws.com\\\/blogs.dir\\\/6653\\\/files\\\/2024\\\/03\\\/image-2.png\",\"contentUrl\":\"https:\\\/\\\/osu-wams-blogs-uploads.s3.amazonaws.com\\\/blogs.dir\\\/6653\\\/files\\\/2024\\\/03\\\/image-2.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/2024\\\/03\\\/13\\\/switching-to-source-code-bug-in-ckeditor\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Switching to Source Code Bug in CKEditor\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/#website\",\"url\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/\",\"name\":\"Drupalista\",\"description\":\"I do Drupal things\",\"publisher\":{\"@id\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/#\\\/schema\\\/person\\\/8088d250fb2e8241cfdacfea532d66da\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/#\\\/schema\\\/person\\\/8088d250fb2e8241cfdacfea532d66da\",\"name\":\"Kelly Holcomb\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/i0.wp.com\\\/osu-wams-blogs-uploads.s3.amazonaws.com\\\/blogs.dir\\\/6653\\\/files\\\/2023\\\/03\\\/Kelly-square.jpg?fit=300%2C300&ssl=1\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/osu-wams-blogs-uploads.s3.amazonaws.com\\\/blogs.dir\\\/6653\\\/files\\\/2023\\\/03\\\/Kelly-square.jpg?fit=300%2C300&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/osu-wams-blogs-uploads.s3.amazonaws.com\\\/blogs.dir\\\/6653\\\/files\\\/2023\\\/03\\\/Kelly-square.jpg?fit=300%2C300&ssl=1\",\"width\":300,\"height\":300,\"caption\":\"Kelly Holcomb\"},\"logo\":{\"@id\":\"https:\\\/\\\/i0.wp.com\\\/osu-wams-blogs-uploads.s3.amazonaws.com\\\/blogs.dir\\\/6653\\\/files\\\/2023\\\/03\\\/Kelly-square.jpg?fit=300%2C300&ssl=1\"},\"url\":\"https:\\\/\\\/blogs.oregonstate.edu\\\/drupalista\\\/author\\\/holcombk\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Switching to Source Code Bug in CKEditor &#8211; Drupalista","description":"With CKEditor Source code mode in Drupal, you can lose changes. Switching back to the preview mode ensures all your changes stick.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blogs.oregonstate.edu\/drupalista\/2024\/03\/13\/switching-to-source-code-bug-in-ckeditor\/","og_locale":"en_US","og_type":"article","og_title":"Switching to Source Code Bug in CKEditor &#8211; Drupalista","og_description":"With CKEditor Source code mode in Drupal, you can lose changes. Switching back to the preview mode ensures all your changes stick.","og_url":"https:\/\/blogs.oregonstate.edu\/drupalista\/2024\/03\/13\/switching-to-source-code-bug-in-ckeditor\/","og_site_name":"Drupalista","article_published_time":"2024-03-13T17:47:49+00:00","article_modified_time":"2024-03-13T17:47:51+00:00","og_image":[{"url":"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6653\/files\/2024\/03\/image-2.png","type":"","width":"","height":""}],"author":"Kelly Holcomb","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kelly Holcomb","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blogs.oregonstate.edu\/drupalista\/2024\/03\/13\/switching-to-source-code-bug-in-ckeditor\/#article","isPartOf":{"@id":"https:\/\/blogs.oregonstate.edu\/drupalista\/2024\/03\/13\/switching-to-source-code-bug-in-ckeditor\/"},"author":{"name":"Kelly Holcomb","@id":"https:\/\/blogs.oregonstate.edu\/drupalista\/#\/schema\/person\/8088d250fb2e8241cfdacfea532d66da"},"headline":"Switching to Source Code Bug in CKEditor","datePublished":"2024-03-13T17:47:49+00:00","dateModified":"2024-03-13T17:47:51+00:00","mainEntityOfPage":{"@id":"https:\/\/blogs.oregonstate.edu\/drupalista\/2024\/03\/13\/switching-to-source-code-bug-in-ckeditor\/"},"wordCount":174,"publisher":{"@id":"https:\/\/blogs.oregonstate.edu\/drupalista\/#\/schema\/person\/8088d250fb2e8241cfdacfea532d66da"},"image":{"@id":"https:\/\/blogs.oregonstate.edu\/drupalista\/2024\/03\/13\/switching-to-source-code-bug-in-ckeditor\/#primaryimage"},"thumbnailUrl":"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6653\/files\/2024\/03\/image-2.png","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/blogs.oregonstate.edu\/drupalista\/2024\/03\/13\/switching-to-source-code-bug-in-ckeditor\/","url":"https:\/\/blogs.oregonstate.edu\/drupalista\/2024\/03\/13\/switching-to-source-code-bug-in-ckeditor\/","name":"Switching to Source Code Bug in CKEditor &#8211; Drupalista","isPartOf":{"@id":"https:\/\/blogs.oregonstate.edu\/drupalista\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blogs.oregonstate.edu\/drupalista\/2024\/03\/13\/switching-to-source-code-bug-in-ckeditor\/#primaryimage"},"image":{"@id":"https:\/\/blogs.oregonstate.edu\/drupalista\/2024\/03\/13\/switching-to-source-code-bug-in-ckeditor\/#primaryimage"},"thumbnailUrl":"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6653\/files\/2024\/03\/image-2.png","datePublished":"2024-03-13T17:47:49+00:00","dateModified":"2024-03-13T17:47:51+00:00","description":"With CKEditor Source code mode in Drupal, you can lose changes. Switching back to the preview mode ensures all your changes stick.","breadcrumb":{"@id":"https:\/\/blogs.oregonstate.edu\/drupalista\/2024\/03\/13\/switching-to-source-code-bug-in-ckeditor\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blogs.oregonstate.edu\/drupalista\/2024\/03\/13\/switching-to-source-code-bug-in-ckeditor\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blogs.oregonstate.edu\/drupalista\/2024\/03\/13\/switching-to-source-code-bug-in-ckeditor\/#primaryimage","url":"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6653\/files\/2024\/03\/image-2.png","contentUrl":"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6653\/files\/2024\/03\/image-2.png"},{"@type":"BreadcrumbList","@id":"https:\/\/blogs.oregonstate.edu\/drupalista\/2024\/03\/13\/switching-to-source-code-bug-in-ckeditor\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blogs.oregonstate.edu\/drupalista\/"},{"@type":"ListItem","position":2,"name":"Switching to Source Code Bug in CKEditor"}]},{"@type":"WebSite","@id":"https:\/\/blogs.oregonstate.edu\/drupalista\/#website","url":"https:\/\/blogs.oregonstate.edu\/drupalista\/","name":"Drupalista","description":"I do Drupal things","publisher":{"@id":"https:\/\/blogs.oregonstate.edu\/drupalista\/#\/schema\/person\/8088d250fb2e8241cfdacfea532d66da"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blogs.oregonstate.edu\/drupalista\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/blogs.oregonstate.edu\/drupalista\/#\/schema\/person\/8088d250fb2e8241cfdacfea532d66da","name":"Kelly Holcomb","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/i0.wp.com\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6653\/files\/2023\/03\/Kelly-square.jpg?fit=300%2C300&ssl=1","url":"https:\/\/i0.wp.com\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6653\/files\/2023\/03\/Kelly-square.jpg?fit=300%2C300&ssl=1","contentUrl":"https:\/\/i0.wp.com\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6653\/files\/2023\/03\/Kelly-square.jpg?fit=300%2C300&ssl=1","width":300,"height":300,"caption":"Kelly Holcomb"},"logo":{"@id":"https:\/\/i0.wp.com\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6653\/files\/2023\/03\/Kelly-square.jpg?fit=300%2C300&ssl=1"},"url":"https:\/\/blogs.oregonstate.edu\/drupalista\/author\/holcombk\/"}]}},"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/drupalista\/wp-json\/wp\/v2\/posts\/68","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/drupalista\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/drupalista\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/drupalista\/wp-json\/wp\/v2\/users\/8564"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/drupalista\/wp-json\/wp\/v2\/comments?post=68"}],"version-history":[{"count":2,"href":"https:\/\/blogs.oregonstate.edu\/drupalista\/wp-json\/wp\/v2\/posts\/68\/revisions"}],"predecessor-version":[{"id":103,"href":"https:\/\/blogs.oregonstate.edu\/drupalista\/wp-json\/wp\/v2\/posts\/68\/revisions\/103"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/drupalista\/wp-json\/wp\/v2\/media?parent=68"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/drupalista\/wp-json\/wp\/v2\/categories?post=68"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/drupalista\/wp-json\/wp\/v2\/tags?post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}