Recipe filter and search bar

The Recipe Kit Filter adds filter menus and an optional recipe search bar to your blog page, or to any page that has a Recipe List, so readers can narrow your recipes by diet, course, cuisine or any tag you use.

The filter is free on every plan. Translating it into other languages uses automatic translations, which are part of the Growth plan.

A recipe blog page with Diet and Cuisine filter menus and a search bar showing matching recipes with thumbnails

Add the filter to your blog page

The filter is an app section, so it needs an Online Store 2.0 theme. These steps put it on your blog page. It can also go on your home page or any other page, together with a Recipe List that shows the recipes it picks; see Use the filter with a Recipe List below. If the section can't go where you want the filter, see Add the filter with code below.

  1. In Shopify admin, go to Online Store > Themes and click Customize.
  2. Use the page menu at the top of the editor to open Blogs, then your blog template.
  3. Click Add section, open the Apps tab and choose Recipe Kit Filter.
  4. Drag the section to where you want it, usually near the top of the page.
  5. Click the Recipe Kit Filter section and set up your filters in the panel on the right. See What each setting does below.
  6. Click Save.

The theme editor's Add section menu on the blog template, with Recipe Kit Filter listed under Apps

Set up your filters

You can set up to three filters, under Filter #1, Filter #2 and Filter #3. Each has three settings:

  • Name. The label shown on the filter, for example "Diet" or "Cuisine".
  • Tags (comma-separated). The blog post tags this filter offers. Separate them with commas or put each on its own line.
  • Style. Dropdown shows a standard menu with an "All" option at the top. Searchable lets readers type to narrow a long list, which suits filters with many options such as cuisines or ingredients.

For example, a Diet filter could use these tags:

vegan, vegetarian, gluten-free, keto, dairy-free

The Filter #1 settings with the name Diet, a list of diet tags and the Searchable style selected

Each tag must match a tag on your blog posts. Capital letters do not matter, but spelling, spaces and hyphens do. For example, gluten free and gluten-free count as different tags when the filter checks which options have recipes. Recipe categories and filtering explains how to keep tags consistent and how to tag posts from Recipe Kit.

When a reader picks an option, the blog page reloads showing only posts with that tag.

Use the filter with a Recipe List

A Recipe List on the same page follows the filter: it shows only recipes whose blog posts have the picked tags, and recipes matching the search box when search is on. Add one in the same section with Add block > Recipe List, below the filter.

  • On your home page or any page that isn't your blog, the Recipe List is what the filter changes. It updates on the spot, without a reload, and the page's address keeps the picked tags, so a shared link opens filtered.
  • On your blog page, hide your theme's blog posts section and let the Recipe List show your recipes, and the list updates without a reload too. While your theme's blog posts show on the page, the filter reloads the page on each pick so both stay in step.

Each Recipe List has a Follow the Recipe Kit Filter setting, on by default. Turn it off for a list that should stay the same, such as a row of featured recipes. Filter and search recipes on any page walks through the setup.

Turn on the recipe search bar

Tick Enable recipe search bar in the section settings. A search box appears beside your filters.

  • Readers type at least 2 characters and results appear after a short pause.
  • Each result shows the recipe's photo and title. Clicking a result opens that recipe.
  • Arrow keys move through the results, Enter opens the highlighted one, and Escape closes them.
  • The search looks at recipe titles, ingredients, tags and more.
  • When a Recipe List shows your recipes on the page, the search box narrows that list as readers type, instead of listing matches under the box. See Use the filter with a Recipe List above.

Search bar size sets the box to Standard or Large. Large is wider, with bigger text and photos in the results.

To have search respect the filters, also tick Limit search results to the active filters. With a filter selected, search then only returns recipes with that tag, or with a matching category or cuisine.

Show every match on a results page

The search box lists the closest matches as the reader types. Tick Press Enter to open a results page to give readers a full page as well. Pressing Enter, or tapping Search on a phone keyboard, opens a page of recipe cards with up to 100 matches, and long lists get a Show more button.

The page uses your store's header and footer. If the reader had a filter selected and search is limited to the active filters, the results page keeps that limit.

A results page for the search "chipotle" showing four recipe cards, three of them with a label such as side dish or dinner under the title

Show a label under each search result

Some stores publish one version of a recipe for each appliance, pan size or product. Search then lists several rows with the same title, and readers can't tell them apart. Label under each search result adds a short label, such as the appliance name, under each title in the search box and on the results page.

The recipe search box with four results for "chipotle", three of them with a label such as side dish or dinner under the title

  1. In the theme editor, click the Recipe Kit Filter section.
  2. Under Label under each search result, choose the filter whose tags should label the results, for example Tag from Filter #1.
  3. Click Save.

The Label under each search result setting with Tag from Filter #1 chosen

How each label is chosen:

  • The label is the first of that filter's tags the recipe has, in the order the filter lists them. A recipe with none of them gets no label.
  • The label reads exactly as the tag is typed in the filter's Tags (comma-separated) box, capitals included. Type Air Fryer for a label that reads "Air Fryer".
  • A recipe has a tag when the tag is one of its Keywords in Recipe Kit, or its category or cuisine. Capital letters don't matter. Tags added to the blog post in Shopify don't count, so if you tag posts in Shopify, add the same words to the recipes' keywords too.

Label results without adding a menu

The filter bar only shows filters that have a name. Fill in a filter's Tags (comma-separated) and leave its Name empty, and it labels search results without adding a menu to the bar. This suits a long list, such as every appliance you sell, that you don't want as a menu.

For example, leave the name under Filter #3 empty, list your appliances as its tags, and set Label under each search result to Tag from Filter #3.

What each setting does

Setting What it does
Alignment Places the filters on the left, center or right of the page.
Enable recipe search bar Adds the search box described above.
Search bar size Standard or Large. Large is wider, with bigger text and photos.
Press Enter to open a results page Pressing Enter in the search box opens a page with up to 100 matching recipes. See Show every match on a results page above.
Limit search results to the active filters Makes search return only recipes that match the selected filter.
Label under each search result Shows each result's tag from the chosen filter under its title. See Show a label under each search result above.
Open filters on hover (desktop) On a computer, a filter opens when the mouse moves over it and closes when it moves away. Phones and tablets still open filters with a tap.
Hide empty filter options Hides tags that no post on this blog uses. On by default. On a page that isn't your blog, every option shows.
Place filter near blog title Moves the filter to just below the first main heading on the page. If the page has none, the filter stays where you placed the section.
Accent Colour The color for selected filters and focus outlines in the filters and search bar.

The Recipe Kit Filter settings from Alignment down to Place filter near blog title, including Search bar size, Press Enter to open a results page and Label under each search result

Change the filter's wording

The Translations heading at the bottom of the settings holds the wording readers see. Leave a box empty to keep the default.

The "1 recipe" and "26 recipes" boxes set the count at the top of the results page. Write {count} where the number goes, for example {count} recettes.

Setting Default
"All" label All
"Clear" label Clear Filters
Search placeholder Search recipes…
"Searching…" text Searching…
"No recipes found" text No recipes found
"1 recipe" text {count} recipe
"26 recipes" text {count} recipes
"Show more" label Show more

These boxes set the wording in your store's main language. To show the filter in other languages, see the next section.

Add the filter with code

Use this when the section can't go where you want the filter. That happens when your page is built as one large section, or when your theme isn't Online Store 2.0.

  1. In Shopify admin, go to Online Store > Themes, click ... next to your theme and choose Edit code.
  2. Under Snippets, click Add a new snippet and name it recipekit-filter.
  3. In Recipe Kit, go to Settings > Installation. Under Install with code, click Copy code next to Recipe filter, paste it in and click Save.
  4. Open the section or template file where the filter should appear, paste this line where you want it and click Save:
{% render 'recipekit-filter', blog_handle: 'recipes', filter_1_name: 'Diet', filter_1_tags: 'vegan, vegetarian, gluten-free' %}

Replace recipes with your blog's handle, the last part of its address. For yourstore.com/blogs/recipes the handle is recipes. Leave blog_handle out on the blog page itself, and on a page with a Recipe List, which then shows the recipes the filter picks. On a page without a Recipe List, blog_handle makes each pick open that blog's tag page.

Choose the settings

Each section setting has a matching word you add to the line, separated by commas. Leave one out to keep its default. Text goes in quotes, and true and false don't need them. This line sets up two filters and the search bar:

{% render 'recipekit-filter', blog_handle: 'recipes', filter_1_name: 'Diet', filter_1_tags: 'vegan, vegetarian, gluten-free', filter_2_name: 'Cuisine', filter_2_tags: 'italian, mexican, thai', filter_2_type: 'combobox', enable_search: true %}
Add this Section setting
blog_handle: 'recipes' None. The blog whose tag pages the filter opens when no Recipe List on the page follows it.
filter_1_name: 'Diet' Name under Filter #1. Use filter_2_name and filter_3_name for the other two.
filter_1_tags: 'vegan, keto' Tags (comma-separated), with filter_2_tags and filter_3_tags for the other two.
filter_1_type: 'combobox' Style set to Searchable. Leave it out for Dropdown.
enable_search: true Enable recipe search bar
search_size: 'large' Search bar size set to Large. Leave it out for Standard.
results_page: true Press Enter to open a results page
scope_search_to_filters: true Limit search results to the active filters
result_label: 'filter_1' Label under each search result. Use filter_2 or filter_3 for the other filters.
open_on_hover: true Open filters on hover (desktop)
hide_empty_options: false Turns off Hide empty filter options, which is on by default.
h1_placement: true Place filter near blog title
alignment: 'left' Alignment: left, center or right. Center by default.
button_colour: '#2f5d50' Accent Colour
all_translation: 'Everything' "All" label. The other wording boxes are cancel_translation, search_placeholder, searching_translation, no_results_translation, result_count_one_translation, result_count_other_translation and show_more_translation.

Only one filter can show on a page.

The filter itself updates on its own, the same as the section. The snippet is a copy, though, so a setting added in a later update reaches your store only once you copy the snippet from Settings > Installation again.

Translate a filter added with code

  1. Add id: 'main' to the line, or any other short name. If you add the filter with code on more than one page, give each its own name.
  2. Open the theme editor on a page that shows the filter and wait a few seconds. Recipe Kit sends the filter's wording to Shopify, the same as when you save the section.
  3. Translate it in Translate & Adapt as described in Translate the wording below.

Translate the filter into other languages

Shopify blog tags cannot be translated, so a German shopper clicking a translated option would normally land on a page with no posts. Recipe Kit keeps the translated label for display and uses your original tag for the link, so translated options still open the right posts.

Before you start, set up automatic translations and install Translate & Adapt. See Translating your recipes into other languages.

Send the filter to Translate & Adapt

Recipe Kit copies each filter section's wording to Shopify when you edit it in the theme editor. It only does this once automatic translations are turned on.

  1. In Shopify admin, go to Online Store > Themes and click Customize.
  2. Open the blog template with the Recipe Kit Filter section.
  3. Click the section, make any change or none, and click Save.
  4. Wait a few seconds. Recipe Kit sends the filter's wording to Shopify about 2 seconds after the section loads.

Do this once per filter section, and again whenever you change its tags or labels.

The Translations settings of the Recipe Kit Filter with the All, Clear, search placeholder, searching and no recipes found boxes

Translate the wording

  1. Open Translate & Adapt. You can also go to Settings > Translations & labels in Recipe Kit and click Manage Translations.
  2. Choose the language.
  3. Under Metaobjects, choose Recipe Kit Filters. Each filter section has its own entry, named [RecipeKit Filter] followed by its filter names, for example [RecipeKit Filter] Diet / Category / Cuisine.
  4. Click Auto-translate and then Translate, or type your own translations.
  5. Click Save.

Translate & Adapt's list of metaobject entries with the [RecipeKit Filter] Diet / Category / Cuisine entry

You can translate the filter names, every tag option, and the five wording settings from the Translations heading.

Each tag option is stored as a link. The link text is what shoppers see, and the link address, which starts with tag:, holds your original tag. Translate only the link text. Never edit the link address. Auto-translate leaves it alone for you.

A filter entry in Translate & Adapt, with the Diet filter's tag options shown as links in the Reference column

Both filter styles, Dropdown and Searchable, use the same translated tags.

When you change a filter's tags or names later, save the section in the theme editor again, then open the entry in Translate & Adapt. It highlights the fields that changed. Translate them and save, for each language.

Troubleshooting

My filter options do not show

Check that each tag in Tags (comma-separated) matches a tag on at least one post in that blog, letter for letter apart from capitals. With Hide empty filter options on, tags no post uses are hidden.

The filter added with code does not show

Check that the snippet is named recipekit-filter and that the render line is in a section or template your page uses. Snippets copied before version 1.4.0 need blog_handle on any page that isn't a blog; copy the snippet from Settings > Installation again to drop that need.

Picking a filter reloads the page

The page also shows your theme's own blog posts, so the filter reloads to keep them in step with your Recipe List. Hide that section in the theme editor, and the Recipe List updates without a reload.

The filter is not in Translate & Adapt

  1. Check automatic translations are turned on in Recipe Kit, under Settings > Translations & labels.
  2. Open the theme editor on the blog template, click the filter section and save.
  3. Wait a few seconds and refresh Translate & Adapt.

A translated option opens an empty page

The link address of a tag was changed during translation. Open the filter entry in Translate & Adapt for that language, delete the translation of the affected tag field, and translate it again, changing only the link text.

A translated page shows "All" instead of the chosen option

Check the filter entry exists and is translated for that language, and that the tags in the filter section match your blog post tags in your main language.

What's next

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us