# 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:** 1\
**Showing post:** 362

<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)

---

_[View the full topic](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233)._
