0 like 0 dislike
198 views
in Sections Anywhere by (1.3k points)

I update the theme and would like to not have to merge in data edits to my new branch.

1 Answer

0 like 0 dislike
by (1.3k points)

The data (content) has always been saved in your theme files and named starting with snippets/sa-.  If those files get copied over, you're set.

However, there is a way to activate saved data to metafields.  These can persist across all themes. By adding atb_use_meta and atb_use_theme_based_meta to your site schema, you can then go to your site settings and turn it on.  Perhaps, the reason you are noticing a change is because you had added it in the past and it is now turned off.

Add this to config/settings_schema.json if it is not already present.

,
  {
    "name": "SectionsAnywhere",
    "settings": [
      {
        "type": "checkbox",
        "id": "atb_use_meta",
        "label": "Use Metafields for Sections Anywhere",
        "info": "Save data to meta",
        "default": false
      },
      {
        "type": "checkbox",
        "id": "atb_use_theme_based_meta",
        "label": "Use Metafields for Current Theme Only",
        "info": "With each theme data is different",
        "default": false
      }
    ]
  }

A copy of the code is in your snippets/atb.liquid file.

image

Welcome to Sections Anywhere Q&A - Saltye, where you can ask questions and receive answers from other members of the community.
...