Skip to content

Calling Url to Iframe from Templater #58

@Di3mex

Description

@Di3mex

I am in the process of building a Templater template for youtube videos. On the top of the note I would love to have the video in an iFrame. So far I have this

# Video
<%* 
let clipboardContent = tp.system.clipboard();
this.app.plugins.plugins['convert-url-to-iframe'].urlToIframe(clipboardContent); 
-%>
## Transcript
<%* app.commands.executeCommandById('ytranscript:paste-transcript') -%>

I get the following error:

plugin:convert-url-to-iframe:6653 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'cmEditor')
    at FormatNotionPlugin.eval (plugin:convert-url-to-iframe:6653:49)
    at Generator.next (<anonymous>)
    at eval (plugin:convert-url-to-iframe:49:61)
    at new Promise (<anonymous>)
    at __async (plugin:convert-url-to-iframe:33:10)
    at FormatNotionPlugin.urlToIframe (plugin:convert-url-to-iframe:6651:12)
    at eval (eval at <anonymous> (plugin:templater-obsidian:1:1), <anonymous>:10:51)
    at eval (plugin:templater-obsidian:3537:35)
    at handleError (plugin:templater-obsidian:3324:14)
    at imports.wbg.__wbg_call_168da88779e35f61 (plugin:templater-obsidian:3536:12)

This is the first time I am trying to directly call a function in a plugin. So maybe that is not a great idea. I could potentially work around this issue by adding a function that takes the URL from the clipboard.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions