You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem?
Cannot insert templates into Canvas cards due to "Templater error: No active editor" error. Forces creation of separate notes just to use templates within Canvas, unnecessarily cluttering vault.
Describe the solution you'd like
Add proper editor detection for Canvas cards, allowing direct template insertion similar to regular notes. Should seamlessly work when selecting a card and triggering a template.
Describe alternatives you've considered
Current workaround: Create temporary note → run template → copy content → paste into Canvas card → delete temporary note. Inefficient and disrupts workflow.
Additional context
Canvas cards use different editor instances than markdown notes. Integration would require detecting these specialized editor instances. Critical feature for users who heavily utilize Canvas in their workflow.
The text was updated successfully, but these errors were encountered:
I am facing the same problem and looking at this issue.
Here is the clue that I have figured out so far.
In Templater.ts, append_template_to_active_file, the error message is triggered by:
if (!active_editor || !active_editor.file || !active_editor.editor) {
log_error(
new TemplaterError("No active editor, can't append templates.")
);
return;
The problem is that in the canvas, when edit text in the node, the active-editor does not have a active-editor.file porperty. Instead, it has a unique (this is my guess) porperty named active-editor.node, which I think can be used to identity whether the current active-editor is a canvas node.
TODO:
try the detection principle mentioned above, to see if it works
After doing this detection, one can try the rest code in the append_template_to_active_file, to see whether they can work for canvas node. My guess is some modification is needed to adopt the "node" type, as for node, every operation will use functions looks like node.xxxx and the canvas may need to be re-rendered.
Is your feature request related to a problem?
Cannot insert templates into Canvas cards due to "Templater error: No active editor" error. Forces creation of separate notes just to use templates within Canvas, unnecessarily cluttering vault.
Describe the solution you'd like
Add proper editor detection for Canvas cards, allowing direct template insertion similar to regular notes. Should seamlessly work when selecting a card and triggering a template.
Describe alternatives you've considered
Current workaround: Create temporary note → run template → copy content → paste into Canvas card → delete temporary note. Inefficient and disrupts workflow.
Additional context
Canvas cards use different editor instances than markdown notes. Integration would require detecting these specialized editor instances. Critical feature for users who heavily utilize Canvas in their workflow.
The text was updated successfully, but these errors were encountered: