Additional Card Fields [Official thread]

If you have a problem with the add-on add-on Additional Card Fields post in this thread. This way I get notified. If you make a new thread I might miss it.

The old support thread was here. There are some useful discussions in it, e.g. on how to use values from the add-on for styling your cards with javascript.

1 Like

May you add a field to show Last Note Modification Date?

This seems useful. I have seen the github. It’s on the todo list. Maybe I’ll have time this week, else in the spring of 2021.

It doesn’t display information:

Anki Version ⁨2.1.37 (6d596c8f)⁊
Python 3.8.1 Qt 5.15.1 PyQt 5.15.1

Operating System: Manjaro Linux
KDE Plasma Version: 5.21.2
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Kernel Version: 5.11.2-1-MANJARO
OS Type: 64-bit

Help please. I added some additional steps to new cards like 1440 2880 and I want to use this add-on to see the difference between cards that are in learning and in review, preferably conditionally, I mean display is learning, don’t display anything if it is not in learning.

Or perhaps I don’t know how to use it properly. I don’t understand why it need a special field.

due to internal changes in Anki the old syntax you use no longer works in Anki 2.1.20 or later. You have 2.1.37 so you need e.g. {{info-LastReview:}}.

@gnomek: The problem in your screenshot is that you are missing question marks. In the description on ankiweb I have this: {{info-TodayLearning?:}}. Names with question marks have been in use since 2015/2019 so I can’t change them without breaking many setups.

It doesn’t change anything. Or I don’t know what is the proper use of it. I expected it will show on cards that are found by searching is:learn= interval learning.

some fields have questions marks, some don’t. Just copy and paste from the documentation of my add-on ankiweb.

For the exact meaning of the special fields I use check the source code, e.g. for "Learning?" here. According to this database description card.type =1 means “card in learning”. This should evaluate to true for cards that are matched by the search term is:learn in the browser.

This is what I did.

- {{info-Learning?:}} - is this card being learned?
- {{info-TodayLearning?:}} - shown if card in learning and in queue 1

https://ankiweb.net/shared/info/744725736

So, I have correct typing on first screenshot. I did copy paste.

you seem to have two problems:

In the screenshots you share you always have “Unknown field: …”. There’s a simple explanation for those messages: Some code in the screenshots you shared does not have the syntax that’s needed in 2.1.37 so that you will get “Unknown field: …” on the right side in the preview for those:

In the screenshot in the message Additional Card Fields [Official thread] - #6 by gnomek there are two errors in your template: It must be {{info-TodayLearning?:}} and {{info-Learning?:}}.

In the first screenshot of your second message at Additional Card Fields [Official thread] - #8 by gnomek you have 10 lines with info fields and the lines 1,2,3,8 do not match the documentation for 2.1.37.

If what I have written on Additional Card Fields (Fork for 2.1) - AnkiWeb is not clear I’m open for suggestions.

 
 
 

If you are wondering about the difference between these two fields:

- {{info-Learning?:}} - is this card being learned?
- {{info-TodayLearning?:}} - shown if card in learning and in queue 1

check the database description: Learning should be the sum of “TodayLearning” and “DayLearning”. TodayLearning should be cards in learning that will be shown again today. This is relevant e.g. for people who besides the default learning steps of “1 10” also use e.g. “1440”.

1 Like

How stupid I was. I am really sorry for taking your time. I now discovered that it actually works and it display proper information in review mode but not in card template preview. I don’t know why I assumed it will show something in preview.

And thank you for explaining the difference between `info-Learning’ and ‘info-TodayLearning’. That is relevant to me.

Both:

{{info-Learning?:}}
{{info-TodayLearning?:}} 

are displayed as "Learning" in review mode. Is there any way to make the value displayed in other way, for example as a translation to my native language or other word, for example {{info-TodayLearning?:}} as "New".

Of course, without changing to what it actually refers as Anki value.

@gnomek: At the moment I’m very busy so I don’t have time to look into new features.

You could try this: I think the code on github is pretty recent but I might have forgotten to upload the latest changes. so your add-on code will be pretty similar. Check in your addons21 folder this file and position anki21__reviewer_additional_card_fields/new_additional_card_fields.py at 349dfbf6f2fe8ec00adff17cf7a3307db1052305 · ijgnd/anki21__reviewer_additional_card_fields · GitHub Then you could try tochange the quoted “Learning” and restart anki.

make sure to have backups and know how to restore them etc. do this at your own risk etc.

1 Like

Great work!

Is it possible to add an option to display if card is in re-learning mode, similar to {{info-Learning?:}} and {{info-New?:}}, but instead {{info-ReLearning?:}}

Thanks!

you could add a line below addInfo["New?"] = "New" if card.type == 0 else "" in the source code of the add-on in the file new_additional_card_fields.py or old_additional_card_fields.py (depending on your version of anki) so that it looks like this:

addInfo["New?"] = "New" if card.type == 0 else ""
addInfo["ReLearning?"] = "ReLearning" if card.type == 3 else ""

I might be wrong about the card type but I think that type = 3 means relearning, see anki/consts.py at 0b9fbd9050c6989a666529eb7696b4fe4ec69de9 ¡ ankitects/anki ¡ GitHub

I haven’t tested this …

when I make a new release I’ll try to remember to include this. i have no timeline for this.

Is Additional Card Field working with Anki 2.1.49 I’ve loaded it several times but when I use {{info-Ease:}} and {{info-Factor:}} I keep getting 0 rather than 250 same with other parameters. Any ideas?

@ccj: new cards and cards that are in learning the first time have a factor of 0. Maybe it’s this. I’d need more info about the affected cards.

Thanks for getting back so quickly. I’ve been using Anki for a couple of years but this is the first time I thought an addon would help so bear with me.

I attach five screenshots to show the situation. The first two show the single addon and the file directory in case that helps. The next shows the start of my 4000+ kanji card deck and the Ease and Review values according to the browser can be seen.

The final two show the html line for the back of the first card (Id = 1) where I have added Ease and Reviews print statements and the values on the back of the card these changes produce.

Does this help

Thanks for any help you can give.

Missing image don’t know why they didn’t go first time.