FROM CACHE - en_header

App block on customers/account page not rendering

d_tehrani
Shopify Partner
56 1 10

Hi.

 

I successfully integrated app block to the product page, but cannot to the account page.

 

I can insert the app block, but the content doesn't render and the app block becomes blank after I insert it.

Screen Shot 2021-08-19 at 13.36.27.png

These are my template and section files.

 

customers/account.json after I insert the app block.

 

 

{
  "sections": {
    "main": {
      "type": "customer-account-content",
      "blocks": {
        "0796873f-63d0-42b6-b001-c461912e8276": {
          "type": "shopify:\/\/apps\/my-app-dev\/blocks\/my-app-block\/070d289b-cc39-4efb-9467-7546ed15d53b",
          "settings": {
          }
        }
      },
      "block_order": [
        "0796873f-63d0-42b6-b001-c461912e8276"
      ],
      "settings": {
      }
    }
  },
  "order": [
    "main"
  ]
}

 

 

 

 

Part of customer-account-content.liquid

 

 

 

   {% for block in section.blocks %}
  {% case block.type %}
    {% when '@app' %}
      {% render block %}
  {% endcase %}
{% endfor %}


{% schema %}
  {
  "name": "Customer account",
    "tag": "section",

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

{% endschema %}

 

 

 

 

The app block

 

 

{% render "my-snippet" %}

{% schema %}
{
  "name": "My App Block",
  "templates": ["customers/account"],
  "target": "section"
}
{% endschema %}

 

 

 

Hope someone can help me with this issue.

 

Thanks.

 

Replies 2 (2)
cshlin
New Member
1 0 0

I don't know if you used the example extension that shopify gave as your boilerplate, but I found that there was a templates filter in app-block.liquid that was restricting the app to only showing up on the product and index page. Removing that fixed it for me.

Paul_vd_Dool
Shopify Partner
89 6 80

Hi @d_tehrani,

 

I'm running into this issue as well. Did you ever manage to solve it?

Doppelganger - Managing duplicate user accounts