Issue:
I am creating a shared deck and designing a custom card template. In the card preview a link will be shown which will be dynamicly generated with various info of the card and notes as url param so that user can report that card in my online portal.
let subdeck = encodeURIComponent('{{Subdeck}}');
let card = encodeURIComponent('{{Card}}');
let frontText = encodeURIComponent('{{Text}}');
let href =`http://127.0.0.1:5500/index.html?subdeck=${subdeck}&card=${card}&front=${frontText}&id=${cardId}`
Current approaches
So far i have found only limited filelds/variable can be used in the template like {{Card}}
but I also need the note id
and card id
.
The two solutions i have found require me to install add-on.
Approach 01:
With this add-on many info can be access as like native ones.
https://ankiweb.net/shared/info/744725736
Approach 02:
javascript api bridge
https://ankiweb.net/shared/info/1490471827
pycmd("AnkiJS.ankiGetCardId()", (ret) => { console.log(ret); });
this works for Anki desktop and another thing to note is that this approach can also be used in ankidroid as they natively support a javascript API.
Approach 03:
By using a permanent uuid filed in the note itselt and passing it on to the link href.
https://ankiweb.net/shared/info/8897764
(lol: new user can only post two links)
Limitation/Problem
So my question is, is there any native way i can retrive info about a card in a card preview template
without taking help from any addon? or is there any other way i can have a button placed in the card preview with that dynamic link?