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
template (render note) with #template and some label definitions
implementation (HTML)
JS code (JS frontend)
I can create clones of the template. What I would like to happen is: for each clone of the template, I set the promoted attributes to different values. Then, the implementation should render each clone differently, based on these attributes. However, how do I access the clone's attributes rather than the template's? As far as I can tell, I can use:
api.startNote - will refer to "implementation" above, from the template's subtree
api.currentNote - will refer to "JS code" above, from the template's subtree
If the render note is the currently open note, I can use api.getActive* functions, e.g., (await api.getActiveContext()).note. However, this fails for child previews, say if foo is open in this tree:
foo
clone 1 of template
clone 2 of template
In that case, the above function will return foo.
So, am I missing something? Is there a way to get the render note clone that is actually being rendered, whether it is the main note or a preview?
The text was updated successfully, but these errors were encountered:
I can create a render note template:
#template
and some label definitionsI can create clones of the template. What I would like to happen is: for each clone of the template, I set the promoted attributes to different values. Then, the implementation should render each clone differently, based on these attributes. However, how do I access the clone's attributes rather than the template's? As far as I can tell, I can use:
api.startNote
- will refer to "implementation" above, from the template's subtreeapi.currentNote
- will refer to "JS code" above, from the template's subtreeIf the render note is the currently open note, I can use
api.getActive*
functions, e.g.,(await api.getActiveContext()).note
. However, this fails for child previews, say iffoo
is open in this tree:In that case, the above function will return
foo
.So, am I missing something? Is there a way to get the render note clone that is actually being rendered, whether it is the main note or a preview?
The text was updated successfully, but these errors were encountered: