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
- Open your Sanity Studio
- Navigate to the Footer document
- If no Footer document exists, create one
Step 2: Copy Footer Text
- Open the Site Settings document
- Locate the
footerTextfield - Copy the entire content (including all language versions if localized)
Step 3: Paste into Footer Document
- Open the Footer document
- Locate the
footerTextfield - Paste the content you copied from Site Settings
- Save the Footer document
Step 4: Verify Frontend
- Check your website footer
- Verify that the footer text displays correctly
- Test all language versions if applicable
Step 5: Remove from Site Settings (Optional)
Once you've confirmed everything works:
- Open the Site Settings document
- Remove or clear the
footerTextfield - 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
Footer Text Not Displaying
- Check Footer Document: Ensure the Footer document exists and is published
- Verify Field Name: Confirm the field is named
footerTextin the Footer document - Check Localization: If using multiple languages, ensure all language versions are filled
- Clear Cache: Clear your cache and rebuild if using static generation
Old Footer Text Still Showing
- Check Cache: Clear browser cache and CDN cache
- Verify Query: Ensure your GraphQL/query fetches from Footer document
- Check Fallback: The system may still fall back to Site Settings if Footer is empty
Multiple Footer Documents
If you have multiple Footer documents:
- Ensure you're querying the correct one
- Use a filter or slug to identify the active footer
- Consider using a singleton pattern for the Footer document
Rollback Plan
If you need to rollback:
- Keep the
footerTextin Site Settings temporarily - The frontend can be configured to check both locations
- Once migration is complete, remove from Site Settings
Support
If you encounter issues during migration:
- Check the Troubleshooting Guide
- Review Footer Configuration
- Verify your Sanity Schemas