Skip to main content

Footer Text Migration Guide

This guide helps you migrate footerText from siteSettings to the Footer document.

Overview

The footerText field has been moved from siteSettings to the Footer document type for better organization and separation of concerns.

Why This Change?

  • Better Organization: Footer-specific content belongs in the Footer document
  • Clearer Structure: Separates global settings from footer configuration
  • Easier Management: Footer content can be managed independently
  • Future-Proof: Allows for more footer-specific features

Migration Steps

Step 1: Access Sanity Studio

  1. Open your Sanity Studio
  2. Navigate to the Footer document
  3. If no Footer document exists, create one
  1. Open the Site Settings document
  2. Locate the footerText field
  3. Copy the entire content (including all language versions if localized)
  1. Open the Footer document
  2. Locate the footerText field
  3. Paste the content you copied from Site Settings
  4. Save the Footer document

Step 4: Verify Frontend

  1. Check your website footer
  2. Verify that the footer text displays correctly
  3. Test all language versions if applicable

Step 5: Remove from Site Settings (Optional)

Once you've confirmed everything works:

  1. Open the Site Settings document
  2. Remove or clear the footerText field
  3. Save the document

Note: The frontend will automatically use the Footer document, so removing it from Site Settings is safe but optional.

Migration Checklist

  • Footer document exists in Sanity
  • Footer text copied from Site Settings
  • Footer text pasted into Footer document
  • Footer document saved
  • Frontend displays footer text correctly
  • All language versions tested (if applicable)
  • Footer text removed from Site Settings (optional)

Schema Changes

Before

// siteSettings schema
{
name: 'siteSettings',
type: 'document',
fields: [
// ... other fields
{
name: 'footerText',
type: 'object',
fields: [
{ name: 'en', type: 'text' },
{ name: 'es', type: 'text' },
{ name: 'ro', type: 'text' }
]
}
]
}

After

// Footer schema
{
name: 'footer',
type: 'document',
fields: [
{
name: 'footerText',
type: 'object',
fields: [
{ name: 'en', type: 'text' },
{ name: 'es', type: 'text' },
{ name: 'ro', type: 'text' }
]
},
// ... other footer fields
]
}

Frontend Changes

The frontend has been updated to fetch footerText from the Footer document instead of Site Settings.

Before

// Old implementation
const footerText = siteSettings?.footerText

After

// New implementation
const footerText = footer?.footerText

Troubleshooting

  1. Check Footer Document: Ensure the Footer document exists and is published
  2. Verify Field Name: Confirm the field is named footerText in the Footer document
  3. Check Localization: If using multiple languages, ensure all language versions are filled
  4. Clear Cache: Clear your cache and rebuild if using static generation
  1. Check Cache: Clear browser cache and CDN cache
  2. Verify Query: Ensure your GraphQL/query fetches from Footer document
  3. Check Fallback: The system may still fall back to Site Settings if Footer is empty

If you have multiple Footer documents:

  1. Ensure you're querying the correct one
  2. Use a filter or slug to identify the active footer
  3. Consider using a singleton pattern for the Footer document

Rollback Plan

If you need to rollback:

  1. Keep the footerText in Site Settings temporarily
  2. The frontend can be configured to check both locations
  3. Once migration is complete, remove from Site Settings

Support

If you encounter issues during migration:

  1. Check the Troubleshooting Guide
  2. Review Footer Configuration
  3. Verify your Sanity Schemas

Next Steps