Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-db.php on line 556

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/util/string.php on line 702

Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/pages/question.php on line 185

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/pages/question.php on line 198

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/util/string.php on line 702

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/util/string.php on line 702

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/app/users.php on line 1277

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/pages/question-view.php on line 473

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/util/string.php on line 702

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/util/string.php on line 702

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-base.php on line 722
How do I make sure content persists across theme changes? Metafields - Sections Anywhere Q&A - Saltye

  • Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-theme-base.php on line 648
    Questions
    Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-theme-base.php on line 661

  • Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-theme-base.php on line 648
    Unanswered
    Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-theme-base.php on line 661

  • Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-theme-base.php on line 648
    Tags
    Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-theme-base.php on line 661

  • Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-theme-base.php on line 648
    Users
    Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-theme-base.php on line 661

  • Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-theme-base.php on line 648
    Ask a Question
    Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-theme-base.php on line 661
0 like 0 dislike
1.7k views

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-theme-base.php on line 160

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-theme-base.php on line 162
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.


Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-theme-base.php on line 935

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-theme-base.php on line 935

1 Answer

0 like 0 dislike

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-theme-base.php on line 160

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-theme-base.php on line 162
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


Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-theme-base.php on line 935

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/users/serverpilot/apps/faqsaltye/public/qa-include/qa-theme-base.php on line 935
Welcome to Sections Anywhere Q&A - Saltye, where you can ask questions and receive answers from other members of the community.
...