# Memrise card template \[support thread\]

**URL:** <https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233>\
**Category:** Card Design\
**Created:** [September 13, 2023, 6:25am UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233 "2023-09-13T06:25:44Z")\
**Posts on this page:** 20\
**Page:** 18

<div class="post-metadata">

**Author:** ![Eltaurus](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/eltaurus/32/10287_2.png) [@Eltaurus](https://forums.ankiweb.net/u/Eltaurus)\
**Post date:** [March 15, 2026, 1:41pm UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/349 "2026-03-15T13:41:56Z")

</div>

> [@tienppham2](#):
>
> I just want to see the time bar came back but I dunno how to do it.

The bar at the top of your screenshot isn’t a part of a card. It likely comes from an add-on, but I don’t recognize it. If you can ask the author of the screenshot directly, that would probably be the best option for finding out where exactly does it come from. You can also ask around here on the forum in a separate thread, where other people are more likely to see the question. Someone might recognize it and help you out (my guess would be that @Shigeyuki is likely to know).

I have plans on adding the timer into Memrise card template itself as well, similarly to how it functioned on the old site, but it likely won’t be a part of either of the imminent updates. I’ve [logged in your request](https://github.com/Eltaurus-Lt/Anki-Card-Templates/issues/29), so that I’ll remember to notify you when I eventually come around to finishing it.

> [@tienppham2](#):
>
> I am trying to use **[Lt-Anki-Addons](https://github.com/Eltaurus-Lt/Lt-Anki-Addons), but I have no idea how to change deck icon and to make it like anki.**

If you only need it for the deck icons, that add-on is obsolete (and I recommend to uninstall it), since this functionality is now built into [the main support add-on](https://ankiweb.net/shared/info/884199977) for the memrise cards. You can find detailed instructions for setting up the icons in the last update post here: [Memrise card template [support thread] - #346 by Eltaurus](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/346)

> [@tienppham2](#):
>
> My apology for annoying you masjesty. But I can’t not find down the way to do it.

You don’t have to concern yourself that much about it​😅. I genuinely appreciate any activity in this thread, so if you have any further questions or require clarification on the answer above, feel free to get back at me at your convenience.

---

<div class="post-metadata">

**Author:** ![Shigeyuki](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/shigeyuki/32/23878_2.png) [@Shigeyuki](https://forums.ankiweb.net/u/Shigeyuki)\
**Post date:** [March 15, 2026, 2:01pm UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/350 "2026-03-15T14:01:45Z")

</div>

Probably that’s the version of the progress bar add-on I fixed, as far as I know these are the progress bar add-ons that work fine with the latest version of Anki (for desktop).

- [Progress bar (Fixed by Shige)](https://ankiweb.net/shared/info/1708250053)
- [Remaining time](https://ankiweb.net/shared/info/1508357010)
- [Life Drain](https://ankiweb.net/shared/info/715575551)
- [Progress bar Actual](https://ankiweb.net/shared/info/1882716549)
- [Repetition Bar](https://ankiweb.net/shared/info/2855055)
- [Bar Chase](https://ankiweb.net/shared/info/1370131826)

---

<div class="post-metadata">

**Author:** ![Eltaurus](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/eltaurus/32/10287_2.png) [@Eltaurus](https://forums.ankiweb.net/u/Eltaurus)\
**Post date:** [April 14, 2026, 12:33pm UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/351 "2026-04-14T12:33:16Z")

</div>

# New Basic card type and note type manager options

[The support add-on](https://ankiweb.net/shared/info/884199977) is updated with a new Note Type, which is designed to be a cross-platform substitute for Anki “basic…” Note Types. By itself, it has minimal content and is intended to serve as a basis for original card templates, while including [complete boilerplate](https://forums.ankiweb.net/t/cross-platform-card-design/69419), automatically assembled to make all essential Anki features fully functional on all platforms. This covers **typing and error highlights for AnkiWeb** (which also makes it accessible for card scripts on AnkiMobile, unlike the stock typing field), working **audio buttons and TTS for AnkiWeb** (which can also be used as alternative for `[sound:]` on all platforms to allow for more control over audio playback from card scripts), and **style normalization** to unify the appearance produced by card styles between desktop, web, and mobile.

 ![Card Front (AnkiWeb)](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/c/7/c7729e26814171aff68f4d36301883941bce4f6d.png) ![Card Back (AnkiWeb)](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/d/b/db08acc4eaa6487b06be303cbd06f0c843e3220d.png)

New cross-platform basic note type can be created the exact same way as the stock basic types: `Tools` → `Manage Note Types` → `Add` → “Add: Basic (Lτ)” → `Ok` → type in a name → `Ok`.

 ![adding the Note Type](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/6/3/6305b961607bccc71656fcea568a657bb75d88c9.png)

* * *

The creation of a new Memrise note type can now be initiated from this window as well: selecting “Add: Memrise (Lτ)” from the list opens [the full customization dialog](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/341#p-187035-v52-note-type-constructor-1) with all the options provided by the template.

---

<div class="post-metadata">

**Author:** ![Eltaurus](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/eltaurus/32/10287_2.png) [@Eltaurus](https://forums.ankiweb.net/u/Eltaurus)\
**Post date:** [May 6, 2026, 8:20pm UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/352 "2026-05-06T20:20:27Z")

</div>

## Card info (minor add-on update)

The add-on now makes certain learning info available to templates so the card appearance can be adjusted accordingly.

For example, @trongan04032002 and @butter_muffin previously asked about displaying full card details the first time it is studied instead of starting with a test right away:

> [@butter\_muffin](#):
>
> I would like the template to show me new words or sentences before practicing them, similar to how it worked in Memrise. Is there a way to achieve the same functionality in Anki?

Now this can be implemented by adding

```JavaScript
(()=>{
  infoL = document.getElementById("lt-card-info");
  if (!infoL || !!document.getElementById('backwrap')) return;
  info = JSON.parse(infoL.textContent);
  if (info.reviewCount === 0 && window.pycmd) {
    pycmd("ans");
  }
})();

```

to the front sides (user scripts section) of a Memrise template, and adding

```JavaScript
(()=>{
  infoL = document.getElementById("lt-card-info");
  if (!infoL) return;
  info = JSON.parse(infoL.textContent);
  if (info.reviewCount === 0) {
    MemFlip(true);
  }
})();

```

to the _user posterior scripts_ section of the back template.

Unfortunately, there will likely remain a brief flash of a test side on the first card viewing, because Anki has to go through the front to get to the back details. Although this is corrigible too, that will require a bit more drastic modifications to the template, so I won’t post them here unless someone really wants to dig into the matter.

* * *

As another usecase, if there still are people interested in displaying card learning progress in the old memrise style with flower images, this also became possible

 ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/7/e/7e6bcb1f4d943ec201fd2872aebf706f57e7c297.png)

* * *

In general, any other template can make use of the card info (as long as the card is reviewed in the desktop app and [the support add-on](https://ankiweb.net/shared/info/884199977) is installed and updated to the latest version). The minimal code required to access the data in a script:

```auto
info = JSON.parse(document.getElementById("lt-card-info")?.textContent || "{}");

```

---

<div class="post-metadata">

**Author:** ![brcollage](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@brcollage](https://forums.ankiweb.net/u/brcollage)\
**Post date:** [May 18, 2026, 6:50pm UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/353 "2026-05-18T18:50:39Z")

</div>

Hello, thanks for share a really complex project to the community, i wanted to ask if you can help me with a question i have about your code, i have a interpretation of your code but not sure if its correct:  
In the front when the user writes the answer in the input the code share the information that the user puts in a global variable, and then you have a temporal frontside in which the information its evaluated and then you show more things.  
My doubt is how you share that information i dont understand how the global variable just stays in the back and then its deleted?

---

<div class="post-metadata">

**Author:** ![Eltaurus](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/eltaurus/32/10287_2.png) [@Eltaurus](https://forums.ankiweb.net/u/Eltaurus)\
**Post date:** [May 19, 2026, 2:42am UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/354 "2026-05-19T02:42:22Z")

</div>

> [@brcollage](#):
>
> how you share that information i dont understand how the global variable just stays in the back and then its deleted?

Submitted answer is passed using standard [sessionStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage). You can find the minimal code for typing and error comparison [here](https://forums.ankiweb.net/t/cross-platform-card-design/69419) (also in the [`Basic` Note Type provided by the add-on](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/351)).

I don’t really understand the second part of your question. If you are referring to the switch between displaying the question form and extra info on the backside, this is done by putting each layout in a respective container, which in turn are assigned `display: none` to leave only one on the screen at a time.

---

<div class="post-metadata">

**Author:** ![Eltaurus](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/eltaurus/32/10287_2.png) [@Eltaurus](https://forums.ankiweb.net/u/Eltaurus)\
**Post date:** [June 18, 2026, 1:31am UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/355 "2026-06-18T01:31:36Z")

</div>

Memrise-styled progress bar can be incorporated into to the template cards with the help of the [Progression](https://ankiweb.net/shared/info/174803219) add-on:

 ![Memrise progress bar](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/e/c/ecfdc485716bf924e06e80242301800bb0ca1f16.jpeg)

The style for recreating the original design (including the bouncing change animation, excluding the corner aliasing bug) can be found below. It does not require any setup beyond copy-pasting as a whole to the `⚙️ USER STYLES ⚙️` section in the `Styling` tab of the [Card Type editor](https://github.com/Eltaurus-Lt/Anki-Card-Templates#relevant-anki-windows):

```css
#lt-progress-bar::before, /* resets */
#lt-progress-bar::after,
#lt-progress-bar *::before,
#lt-progress-bar *::after {
    display: none;
}
#lt-progress-bar,
#lt-progress-bar * {
    all: revert;
}

#lt-progress-bar {
    display: flex;
    flex-wrap: wrap;
    height: fit-content;
    box-sizing: border-box;
    background: var(--col-input-bg);

    position: static;
    max-width: calc(60rem - 6.75rem);
    min-width: 13rem;
    box-sizing: content-box;

    width: calc(100vw - 2 * 1rem);
    margin: 1rem auto calc(0rem);

    border-radius: 0.25rem;
    overflow: hidden;
}

#lt-progress-bar span {
    display: none;
}

body.card:has(#lt-progress-bar) {
    min-height: calc(100vh - 1rem);
}

@media (min-width: 33.25rem) {
  #lt-progress-bar {
    margin: 2rem auto calc(-2rem - 0rem);
  }
  body.card:has(#lt-progress-bar) {
    min-height: calc(100vh - 2rem);
  }
}

@media (min-width: 38.25rem) {
  #lt-progress-bar {
    margin: 2rem auto calc(-2rem - 1rem);
    width: calc(100vw - 2 * 2rem);
  }
}

@media (min-width: 53.25rem) {
  #lt-progress-bar {
    margin: 2rem auto calc(-2rem - 2rem); /* height + top-margin */
  }
}

#lt-progress-bar .prog-segment.done:not(.empty):not(:has(~ .done:not(.empty))) {
    border-radius: 0 0.25rem 0.25rem 0;
}

#lt-progress-bar .prog-segment {
    flex-basis: 0;
    flex-grow: var(--count);
    height: 2rem;
}

#lt-progress-bar .prog-segment.done {
    background: var(--col-audio-bg);
    order: -1;
}

#lt-progress-bar .prog-segment.future,
#lt-progress-bar .prog-segment.cooldown {
    display: none;
}

#lt-progress-bar .prog-segment.animated {
    transition: flex-grow 0.2s;
    transition-timing-function: cubic-bezier(.28, 2.0, .77, .77);	
}

```

Additional adjustments can be appended to further differentiate between different Anki card states (new/review/learn/relearn) in the not completed segment of the progress bar.

(pinging @tienppham2 as a follow-up to [the progress bar discussion](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/348)).

---

<div class="post-metadata">

**Author:** ![kaiu](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/kaiu/32/32616_2.png) [@kaiu](https://forums.ankiweb.net/u/kaiu)\
**Post date:** [June 29, 2026, 9:05am UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/356 "2026-06-29T09:05:47Z")

</div>

I have the “Memrise (Lτ)” note types. I installed them a while ago. Today I decided to install the Anki ones I created two weeks ago: [Releases · ankitects/anki · GitHub](https://github.com/ankitects/anki/releases)  
File “anki-26.05-win-x64.msi”.  
Anki 26.05 (e64c6b1a) (ao)  
Python 3.13.13 Qt 6.11.0 PyQt 6.11.0  
Platform: Windows-10-10.0.19045

What else does the addon do? [https://ankiweb.net/shared/info/884199977](https://ankiweb.net/shared/info/884199977)

I installed it because I thought there might be something new in the design of the “Memrise (Lτ)” note types. I needed to analyze the “Close” note type and figure out what could be changed and improved. I don’t really use your addons, but overall they’re useful, of course.

I took screenshots. I had other addons at the beginning, too. But okay, I’ve only kept yours, and still, right after I start using Anki, it constantly loads and leaks memory.

 ![error1](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/8/f/8f19d9b73e840614755b683fc3a89bef8803777f.jpeg)  
 ![error2](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/9/1/91917c0751382792bd2cee83f7c50219beacd62e.jpeg)  
 ![error3](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/6/1/61fe68610840d395dd17c79340eedc842be174db.jpeg)  
 ![error4](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/9/9/992eee96825450dfdd8730c8032741f44060e944.jpeg)  
 ![error5](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/d/b/dbec67b5aa9cb5a8b433622840de6a25338f4b01.jpeg)

---

<div class="post-metadata">

**Author:** ![Eltaurus](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/eltaurus/32/10287_2.png) [@Eltaurus](https://forums.ankiweb.net/u/Eltaurus)\
**Post date:** [June 29, 2026, 10:49am UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/357 "2026-06-29T10:49:10Z")

</div>

The errors in the screenshots are coming from [the deck thumbnails](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/346). Since JS doesn’t have a direct access to the collection folder, it can’t detect the correct extensions for the thumbnails beforehand. So it relies on cycling through the predefined list until a file is loaded successfully or the list is exhausted. Errors coming from missing assets also cannot be caught by JS, so they are left in the console. If you don’t use any thumbnails, you can disable this whole part of the add-on by setting “deck styling” to `false` in the configs.

I can’t think of the way the urls can get down to what is shown in your case, though. They should contain names for the decks as well as the prefix `_thumb_`. Can you share the names for the decks on your main screen? Is the “default” deck kept there?

I’m not sure what part of the screenshots should indicate a memory leakage, for me enabling the add-on has barely any influence on the ram usage (my specs are the same, except for win11 instead of 10). The add-on also doesn’t do anything with the mpv player, so I assume the running process is from some other activity inside Anki.

---

<div class="post-metadata">

**Author:** ![kaiu](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/kaiu/32/32616_2.png) [@kaiu](https://forums.ankiweb.net/u/kaiu)\
**Post date:** [June 29, 2026, 12:50pm UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/358 "2026-06-29T12:50:35Z")

</div>

> [@Eltaurus](#):
>
> setting “deck styling” to `false` in the configs

Yes, it helped.

The error only occurred in one profile, which had a lot of decks, about 9 screens down, or 59 if you’re looking at it on the web.  
The AI ​​suggested this solution, and the error also went away.

```auto
/*
function retry(imgL) {
  const currentExt = imgL.src.split('.').pop();
  const i = extList.indexOf(currentExt) + 1;
  if (i < extList.length) {
    imgL.src = imgL.src.slice(0, -currentExt.length) + extList[i];
  } else {
    imgL.remove();
  }
}
function thumbHTML(deckname) {
  if (typeof(extList) === 'undefined' || !extList[0]) return ``;
  return `<img src='_thumb_${deckname}.{extList[0]}' height="0" width="0" onload="this.classList.add('deckthumb');this.removeAttribute('height');this.removeAttribute('width')" onerror="retry(this)"\>`;
}
*/

function retry(imgL) {
    // Infinite loop protection
    if (!imgL.dataset.retryCount) {
        imgL.dataset.retryCount = 0;
    }
    
    if (parseInt(imgL.dataset.retryCount) >= extList.length) {
        imgL.remove();
        return;
    }
    
    imgL.dataset.retryCount = parseInt(imgL.dataset.retryCount) + 1;
    
    try {
        const url = imgL.src;
        const baseUrl = url.split('?')[0].split('#')[0];
        const lastDot = baseUrl.lastIndexOf('.');
        
        if (lastDot === -1) {
            imgL.remove();
            return;
        }
        
        const currentExt = baseUrl.substring(lastDot + 1);
        const baseName = baseUrl.substring(0, lastDot);
        const i = extList.indexOf(currentExt) + 1;
        
        if (i < extList.length && extList[i]) {
            imgL.src = baseName + '.' + extList[i];
        } else {
            imgL.remove();
        }
    } catch (e) {
        imgL.remove();
    }
}

function thumbHTML(deckname) {
    if (typeof(extList) === 'undefined' || !extList || !extList[0]) return '';
        
    return `<img src='_thumb_${deckname}.${extList[0]}' 
                 height="0" width="0" 
                 onload="this.classList.add('deckthumb');this.removeAttribute('height');this.removeAttribute('width')" 
                 onerror="retry(this)">`;
}

```

---

<div class="post-metadata">

**Author:** ![Eltaurus](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/eltaurus/32/10287_2.png) [@Eltaurus](https://forums.ankiweb.net/u/Eltaurus)\
**Post date:** [June 29, 2026, 2:57pm UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/359 "2026-06-29T14:57:37Z")

</div>

Thank you for the information. From the code alone, I can’t find what is so functionally different between the two implementations and what edge case throws the original one into an infinite loop. But I’ll probably move the thumbnail file search to the python section at some point anyway, as console errors do get increasingly annoying over time.

---

<div class="post-metadata">

**Author:** ![kaiu](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/kaiu/32/32616_2.png) [@kaiu](https://forums.ankiweb.net/u/kaiu)\
**Post date:** [June 29, 2026, 4:19pm UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/360 "2026-06-29T16:19:00Z")

</div>

AI:  
What are the problems in this commented code and why does uncommented code help?

```auto
Looking at the commented code and the uncommented code, here are the main problems in the commented version and how the uncommented code fixes them:

Problems in the commented code:
1. Infinite Loop Risk

// Commented code - no retry count tracking
function retry(imgL) {
  const currentExt = imgL.src.split('.').pop();
  const i = extList.indexOf(currentExt) + 1;
  if (i < extList.length) {
    imgL.src = imgL.src.slice(0, -currentExt.length) + extList[i];
  }
}

Problem: If the image keeps failing to load, the onerror handler will keep calling retry() indefinitely, creating an infinite loop.

Fix: The uncommented code tracks retry attempts with dataset.retryCount and stops after trying all extensions.

2. URL Parsing Vulnerabilities

// Commented code - naive parsing
const currentExt = imgL.src.split('.').pop();
imgL.src = imgL.src.slice(0, -currentExt.length) + extList[i];

Problems:

Doesn't handle URL parameters (? or #)

Assumes the last dot is the extension delimiter

Vulnerable to URLs with multiple dots in the path

Fix: The uncommented code properly parses URLs:

Problems:

Doesn't handle URL parameters (? or #)

Assumes the last dot is the extension delimiter

Vulnerable to URLs with multiple dots in the path

Fix: The uncommented code properly parses URLs:
const url = imgL.src;
const baseUrl = url.split('?')[0].split('#')[0]; // Remove query/hash
const lastDot = baseUrl.lastIndexOf('.'); // Find actual extension
const baseName = baseUrl.substring(0, lastDot); // Get base name

3. No Error Handling
Problem: The commented code has no try-catch block, so any unexpected error would break execution.

Fix: The uncommented code wraps the logic in a try-catch block and removes the image on any error.

4. Missing Extension Validation
Problem: The commented code doesn't check if extList[i] exists or is valid before using it.

Fix: The uncommented code checks extList[i] before constructing the new URL.

5. No Clean Exit on Failure
Problem: When all extensions are exhausted, the commented code just does nothing (the image stays broken).

Fix: The uncommented code properly removes the image when all retry attempts are exhausted.

6. HTML Attribute Issues
Problem: The commented code has {extList[0]} as a literal in the HTML string instead of concatenating properly.

Fix: The uncommented code properly concatenates: '_thumb_${deckname}.${extList[0]}'

7. Missing Self-Closing Slash
Problem: The commented code ends with \> (escaped slash) which is invalid HTML.

Fix: The uncommented code uses proper HTML: >

Key Improvements Summary:
Retry limiting - Prevents infinite loops

Proper URL parsing - Handles query strings, hash fragments, and complex paths

Error handling - Graceful failure with try-catch

Validation - Checks for valid extensions before using them

Cleanup - Removes the image when all options are exhausted

Proper string interpolation - Correct HTML generation

State tracking - Uses data attributes to track retry attempts per image

```

---

<div class="post-metadata">

**Author:** ![Eltaurus](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/eltaurus/32/10287_2.png) [@Eltaurus](https://forums.ankiweb.net/u/Eltaurus)\
**Post date:** [June 29, 2026, 7:26pm UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/361 "2026-06-29T19:26:43Z")

</div>

As expected of an AI response, it mostly provides general suggestions that might be valid in some other cases, but do not bear much relevance when the full context is considered. For example, the suggestion about parsing urls does not take into account that in this case, we aren’t dealing with arbitrary inputs. They are generated by the add-on itself and thus, by construction, cannot contain any parameters.

---

<div class="post-metadata">

**Author:** ![Eltaurus](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/eltaurus/32/10287_2.png) [@Eltaurus](https://forums.ankiweb.net/u/Eltaurus)\
**Post date:** [July 28, 2026, 10:02pm UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/362 "2026-07-28T22:02:21Z")

</div>

## Add-on update: API for card templates

Similarly to [Card Info](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/352) earlier, this update introduces additional _backend_ features to [the add-on](https://ankiweb.net/shared/info/884199977), enabling more advanced customization for all card templates.

### **1. Reviewer Actions**

Several actions normally available in the bottom right `More` menu during card reviews, can now be performed by template scripts through respective `pycmd` commands:

1. **Suspend/bury actions**

2. **Flags**

3. **Voice actions**

4. **Undo**

Any of the actions above can be easily turned into a button and added to a card template:

```HTML
<button onclick=pycmd("action::suspend_card")>Suspend</button>

```

![Reviewer action button](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/6/b/6b34b1d1d365401e18996bcde75827c4f046f720.png)

### **2. Browser Search**

```JavaScript
pycmd(`action::search:_your_search_query_`);

```

allows opening the Anki Browser and quering for cards with all the [standard syntax](https://docs.ankiweb.net/searching.html) (no extra escaping after `action::search:` is required). Example use:

```JavaScript
search_query = '"English*:to * out" OR tag:phrasal_verb::_out';
pycmd(`action::search:${search_query}`);

```

This will search for cards with phrasal verbs ending with " out" by matching contents of any field against the pattern or by looking at cards explicitly marked with the respective [hierarchical tag](https://docs.ankiweb.net/editing.html#using-tags):

 ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/4/8/48884a9afa7d479c0203935fc86ff668d5df9582.png)

Similarly,

```JavaScript
pycmd(`action::search:cid:1653480217073`);

```

can be used to open any specific card for editing.

### **3. Persistent `localStorage`**

Desktop Anki [does not keep the contents](https://forums.ankiweb.net/t/localstorage-is-apparently-not-working-anymore-on-ankidesktop/46160) of `localStorage` after closing the application, practically making it function as another `sessionStorage` instead (unlike AnkiDroid, where saving localStorage data can be enabled by toggling on `localStorage in Study Screen` in Advanced settings, or AnkiWeb, where it works by default in any browser).  
This limits card templates, as features, such as appearance settings, can’t be made work reliably across all the platforms, unless they are [edited directly in the source code](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/163#p-147991-h-1-template-themes-2) for every Card Type.

There [already is an add-on](https://ankiweb.net/shared/info/92595818) for making `localStorage` [function as intended](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage), but this implementation works differently and has multiple advantages:

1. It does not modify card templates themselves so it **does not leave any garbage** that has to be manually cleared after the add-on is disabled or uninstalled
2. It **does not require any setup** , and makes all localStorage content automatically saved simply by enabling the add-on
3. The localStorage is **loaded on startup** , making it available to card templates **immediately** , instead of only after a first card is flipped
4. **Works in all Anki windows** , not just the Reviewer. This provides more opportunities for other add-ons and add-on/card-template interaction. For example, adjusting appearance of field contents in the Editor depending on options selected during reviews is possible
5. All localStorage changes are saved immediately (instead of on finishing a review or similar events) which **prevents data loss when the window is terminated** with `[x]` or in case the app crashes (the save is not triggered by assignments such as `localStorage['key'] = ...`, so explicit `localStorage.setItem('key', "value")` should be used instead at all times)
6. **Stores data** on the disk **in a safe, strict data format** (json) instead of a mutable javascript. It also **does not force desktop storage to mobile** , which would prevent changes made in AnkiDroid itself from having any consistent effect (the storage is still synced between all _desktop_ profiles connected to the same cloud collection)

---

<div class="post-metadata">

**Author:** ![kaiu](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/kaiu/32/32616_2.png) [@kaiu](https://forums.ankiweb.net/u/kaiu)\
**Post date:** [July 28, 2026, 10:13pm UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/363 "2026-07-28T22:13:39Z")

</div>

```auto
pycmd(\`action::search:${search_query}\`);

```

Does this code work only because you install the addon and intercept “webview\_did\_receive\_js\_message”?

---

<div class="post-metadata">

**Author:** ![Eltaurus](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/eltaurus/32/10287_2.png) [@Eltaurus](https://forums.ankiweb.net/u/Eltaurus)\
**Post date:** [July 28, 2026, 10:17pm UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/364 "2026-07-28T22:17:04Z")

</div>

Yes, all the actions are implemented via `webview_did_receive_js_message`

---

<div class="post-metadata">

**Author:** ![Eltaurus](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/eltaurus/32/10287_2.png) [@Eltaurus](https://forums.ankiweb.net/u/Eltaurus)\
**Post date:** [August 17, 2026, 1:48pm UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/365 "2026-08-17T13:48:12Z")

</div>

## Example usage for [the browser search](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/362#p-198695-h-2-browser-search-3) functionality

One of the main sources of errors when answering cards is memory interference. That is when two concepts get unconsciously associated with one another (in meaning, sound, or some other, less direct, way) and are often confused during recall despite being individually well-known.

To find out, if an incorrect answer is caused by interference, one might want to search for other cards in the collection containing the typed word. API from [the last update](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/362) allows to facilitate this process reducing it to a click on the “your answer” element:

 ![Typed answer search](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/0/e/0e478c9ee4a7d8a61825507ace2591ba5d40c2d3.png)  
(The search is compatible with the [highlight add-on](https://ankiweb.net/shared/info/225180905))

To enable this function one should place the following script into the `user posterior scripts` section on the _Back Template_ of a Memrise Card Type:

```JS
document.querySelector(".mem-alert")?.setAttribute("onclick", "pycmd(`action::search:${this.textContent}`)");

```

and add the styles for interactivity:

```CSS
.mem-alert[onclick]:hover {
    cursor: pointer;
    text-decoration: underline;
}

```

* * *

The functionality is not limited to the Memrise template and can be implemented for Basic Anki cards (or any other card that uses native Anki typing) in a similar way:

 ![Basic card search](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/2/2/22084ed922998f1bbc9cf76b4cb4fb137e439579.png)

Script for the _Back Template_:

```JS
<script>
typedLs = document.querySelectorAll("#typeans:has(#typearrow) span:not(br ~ span)");
typedAns = [...typedLs].map(L=>L.textContent).join("");
typedLs.forEach(L=>L.setAttribute('onclick',`pycmd("action::search:${typedAns}")`));
</script>

```

Styling:

```CSS
#typeans:has(#typearrow):has(span:not(br ~ span):hover) [onclick] {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    cursor: pointer;
}

```

* * *

The found result can then be added to the respective `Choices ...` field for multiple-choice cards. Choices gathered over time in this way instead of [automated random filling](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/54) make for much more effective cards in general and a useful tool for dealing with interference.

---

<div class="post-metadata">

**Author:** ![Eltaurus](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/eltaurus/32/10287_2.png) [@Eltaurus](https://forums.ankiweb.net/u/Eltaurus)\
**Post date:** [September 16, 2026, 8:27am UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/366 "2026-09-16T08:27:43Z")

</div>

## Technical add-on update

- **Keyboard shortcuts** are reworked to make the system **friendlier to mixing different templates** in the collection. [Previous approach of reserving certain keys](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/156), that required [config editing and patching all the other templates](https://github.com/Eltaurus-Lt/Anki-Card-Templates/issues/15), is retired. Now the add-on automatically detects what kind of Note Type is currently being studied and handles shortcuts accordingly. This allows the Memrise templates to use number keys for answering multiple-choice and tapping questions, auto-rating answers on `Enter` (instead of rating them “Good” with respective Anki shortcut by default), using `Space` for forcing info screen, etc., while leaving shortcut functionality on other templates completely unaffected.

- [**Deck thumbnail**](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/346#p-191305-deck-thumbnails-and-memrise-course-styles-1) file detection is now being handled on the Python side instead of JavaScript, which allows **avoiding [the issue and the error log flooding](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/356)** reported by @kaiu. It also should prevent [layout jittering on the deck screen load](https://en.wikipedia.org/wiki/Flash_of_unstyled_content) (at a cost of lag for precomputing the parameters, which might still be noticeable for large collections).

- A **bug** caused by race condition when [editing alts via GUI](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/196), which used to occasionally throw **“Database appears to be in an inconsistent state”, is patched**.

Furthermore, the add-on received a major refactoring, which should significantly facilitate further updates. By itself, it should not have any implications for the add-on functionality, but realistically, considering the scale of changes, at least some unintended effects are likely. Any feedback on the matter is welcome, as always.

---

<div class="post-metadata">

**Author:** ![Eltaurus](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/eltaurus/32/10287_2.png) [@Eltaurus](https://forums.ankiweb.net/u/Eltaurus)\
**Post date:** [October 15, 2026, 11:27pm UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/367 "2026-10-15T23:27:59Z")

</div>

Added an option to set deck thumbnails using GUI (via the deck’s ⚙ menu):

 ![setting a thumbnail](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/6/5/650e54f8cf3fe5076f5dba6d46253c5199b3d554.png)

[The older way](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/346) remains functional, but is deprecated now, and it is recommended to disable the older thumbnails by setting

```JSON
"thumbnail extensions": []

```

in the Add-on’s config in order to slightly speed up the deck screen refreshing. This won’t affect the thumbnails set via GUI, which support any image file extensions regardless. The new thumbnails are also less fragile and remain linked to their decks if the later are renamed. A set thumbnail can be removed from the same ⚙ menu.

---

<div class="post-metadata">

**Author:** ![Eltaurus](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/eltaurus/32/10287_2.png) [@Eltaurus](https://forums.ankiweb.net/u/Eltaurus)\
**Post date:** [November 14, 2026, 5:49pm UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/368 "2026-11-14T17:49:24Z")

</div>

# Batch Import

The add-on now allows batch import of Memrise courses downloaded with the [Chrome extension](https://forums.ankiweb.net/t/an-alternative-to-memrise2anki-support-thread/30084):

 ![menu](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/5/c/5c65dfb632b601630b3ab97257f3680066936ee6.png)

**Any number of courses** in **folders with any degree of nesting** can be processed and imported in one go (if there are **unrelated files** in the selected folders, they will be **automatically filtered out** ):

 ![import settings](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/2/0/205a1c6e8a842da5dec87b2cdf098c5cb6937548.png)  
Import “Learning progress” and “Audio Questions” settings do not have any effect yet

The add-on handles [all the necessary steps](https://github.com/Eltaurus-Lt/CourseDump2022#-importing-into-anki), including **copying media files** and creating decks, as well as **setting all the required Note Types** with different kinds of questions and properly labeled fields for each course:

 ![import result](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/7/1/715a459c5d3ab23d52789b8630766921b08576ab.png)

It also **recreates course tree structure** from the imported folders, adds **thumbnails for courses** with downloaded metadata (requires Anki restart after the import to be displayed), and adds **descriptions and author credits** visible on the deck overview screen:

 ![courses and metadata](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/3/c/3c48be46065f32f23d55865bb6ccb839459da7ce.png)

additional thumbnails can be set using the [deck settings menu](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/367)

* * *

The import functionality is still at the draft stage, but any **testing** to assess how well different courses are handled **would be very much appreciated**.

[Previous page](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233.md?page=17)
