Is it possible to add an app block into the header?

Solved

Is it possible to add an app block into the header?

PatrickSon
Shopify Partner
3 1 1

I see some similar questions from years ago without answers, so I figured I'd start a new discussion.

 

Is it possible to add a custom App Block from a Theme Extension to the header in a Shopify store? e.g. next to the search and cart buttons. Even when I target `"templates": ["*"]` in my schema, the app block doesn't appear as an option in the dropdown.

Accepted Solution (1)

PatrickSon
Shopify Partner
3 1 1

This is an accepted solution.

We figured it out:  I was missing "groups": ["header"] in my "enabled_on" schema.

View solution in original post

Replies 3 (3)

PaulNewton
Shopify Partner
7746 679 1617

Hi @PatrickSon 👋

Check if the relevant sections have app blocks in the schema

https://shopify.dev/docs/storefronts/themes/architecture/sections/section-schema#blocks

 

A theme has to be made to accept app-blocks in it's schema of any relevant sections, such as a header;  not to be confused with a header-group that in turn contains sections with it's sections attribute.

 

 

 

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


PatrickSon
Shopify Partner
3 1 1

I did see that `header.liquid` does have

"blocks": [
    {
      "type": "@app"
    }
  ]

And it does appear to iterate over blocks above, so I'm wondering why my app block doesn't appear as an option in the theme editor.

PatrickSon
Shopify Partner
3 1 1

This is an accepted solution.

We figured it out:  I was missing "groups": ["header"] in my "enabled_on" schema.