The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December. Read our blog post for more info about this change.
Found this content helpful? Log in or sign up to leave a like!
I'm using editor_button placement to embed some text into a Rich Content Editor via LTI Deep Linking. Is there any way to replace an old RCE's content with a new text coming from LTI response? Right now I'm only able to append a new text to existing one.
Hi @RuslanDauhiala,
Since nobody else has responded in the last week, I just wanted to at least give my perspective as a Canvas admin. I have never seen an LTI tool overwrite all of the content in the RCE using the editor button placement. I don't want to say it's impossible, because I'm not sure, but I think that would really be unexpected behavior based on the way all of the LTI apps I have installed right now work.
I hope this info helps guide your potential development!
-Chris
Hiya @RuslanDauhiala,
You can do this in a LTI 1.1 tool by returning a special type for your content item. If you send this back from your tool:
{
"@context": "http://purl.imsglobal.org/ctx/lti/v1/ContentItem",
"@graph": [
{
"@type": "lti_replace",
"mediaType": "text/html",
"text": "<h1>All your editor content</h1>....",
"placementAdvice": { "presentationDocumentTarget": "embed" }
}
]
}
Then it will replace all the existing content in the editor. By passing in the variable $com.instructure.Editor.contents in the custom launch parameters the tool can take the current contents, modify them and pass them back to the editor.
You can see this all in action in a simple app we built that allows table of contents to be automatically generated for long documents based off the headings in them.
https://www.eduappcenter.com/apps/6373
Thank you @wyelearning for your response!
Yeap - I use $com.instructure.Editor.contents to pass an RTE context, but I'm using LTI1.3:
'https://purl.imsglobal.org/spec/lti-dl/claim/content_items': [
{
'type': 'html',
'html': 'New RTE content<br><br>'
}
],
will see if I can pass "lti_replace" type instead of "html".
I'm not sure this will work with LTI 1.3 as it looks like the code supporting it is only working for the LTI 1.1 JSON:
Thank you Matt!
Hello @RuslanDauhiala, have you found the solution for LTI 1.3?
Sounds like LTI 1.3 tool is be able to replace the contents of the editor window per Matt's post below but I haven't tried it yet.
Good news, Instructure have recently added support for LTI 1.3 tools to be able to completely replace the contents of the editor window.
https://github.com/instructure/canvas-lms/commit/c1f18b87743b50293a5997118d4c47f9d84224ac
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in