Twig hook names

Each Twig template hook and the React slot that replaces it, for moving a theme or an app from Twig.

Read this when you move a Twig theme, or an app that used Twig template hooks, to React.

In Twig, a template placed a hook with {% hook 'cart:items.start' %}. In React, the engine places a slot with <HookSlot name="cart:items.start" />, and your code fills it with hookRegistry.register (see the Slots overview). Most names stayed the same. This page lists every Twig name and what to use now.

Same name

These work in React under the same name. Only the way you fill them changed.

AreaNames
Pagehead:start, head:end, body:start, body:end
Product pageproduct:single.description.start, product:single.description, product:single.description.end, product:single.form.start, product:single.form.end
Brandsbrands:index.items.start, brands:index.items.end
Cartcart:items.start, cart:items.end, cart:summary.start, cart:summary.end, cart:submit.start, cart:submit.end
Accountcustomer:notifications.items.start, customer:notifications.items.end, customer:orders.index.items.start, customer:orders.index.items.end, customer:orders.single.details.start, customer:orders.single.details.end, customer:wishlist.items.start, customer:wishlist.items.end, customer:profile.form.start, customer:profile.form.end
Thank-you pagethank-you:start, thank-you:items.start, thank-you:items.end, thank-you:end

New name

TwigReactWhere
product:index.items.startproduct:list.items.startBefore the product grid on product listing pages
product:index.items.endproduct:list.items.endAfter the product grid
blog:index.items.startblog:items.startBefore the article list
blog:index.items.endblog:items.endAfter the article list
blog:single.items.startblog:single.start (closest)The top of an article page
blog:single.items.endblog:single.end (closest)The bottom of an article page

No React slot

The engine renders no slot for these. Use the closest one, or the tool listed.

TwigUse instead
brands:single.details.start, brands:single.details.endproduct:list.start, which a brand page renders after the brand banner
brands:single.items.start, brands:single.items.endproduct:list.items.start, product:list.items.end
customer:profile.form.fields.start, customer:profile.form.fields.endcustomer:profile.form.start, customer:profile.form.end
customer:profile.form.submit.start, customer:profile.form.submit.endcustomer:profile.form.end
component:header.menu.start, component:header.menu.endheader:start, header:end, or replace the header (see Header and footer)
body:classesuseDocumentClass
<page-slug>:start, <page-slug>:endThe .start and .end slots of that page, listed in the catalog

React-only slots

React has slots Twig never had, such as header:start, footer:end, home:content, product:details.start, product:related.end, customer:wallet.transactions.start and the blog category, tag and author slots. The catalog lists them all.

Gotchas

  • A name the engine never renders does nothing and raises no error. Check each old name against this page.
  • If you replaced a page or layout, render its slots yourself with HookSlot, with the same names.

See also

On this page