Skip to content

Multiple Repositories

The module supports working with multiple Prismic repositories, allowing different stores or themes to use different content repositories.

Configuration

Enabling Multi-repo Support

  1. Go to Stores > Configuration > Elgentos > Prismic.IO
  2. Navigate to Multi Repository section
  3. Set "Enable Multiple Repositories" to "Yes"
  4. Configure the "Repository Field" setting

Repository Field

The repository field determines which Prismic field contains the repository information:

{
  "Main": {
    "repository": {
      "type": "Text",
      "config": {
        "label": "Repository"
      }
    }
  }
}

Implementation

Store-specific Repositories

Each store view can connect to a different Prismic repository:

  1. Switch to specific store view in admin
  2. Configure Prismic API endpoint for that store
  3. Set appropriate API token

Cache Considerations

When using multiple repositories:

  1. Cache Flush Settings

    <prismicio>
        <cache_flush>
            <content_types>page,blog_post</content_types>
        </cache_flush>
    </prismicio>
    

  2. Cache Tags

  3. Each repository gets unique cache tags
  4. Content types are prefixed with repository ID
  5. Cache is cleared per repository

Best Practices

  1. Repository Organization
  2. Use consistent content types across repos
  3. Document repository purposes
  4. Consider content sharing needs

  5. Performance

  6. Monitor API usage per repository
  7. Configure appropriate cache settings
  8. Consider CDN implementation

  9. Maintenance

  10. Keep repositories synchronized
  11. Document repository relationships
  12. Plan for content migrations

Troubleshooting

  1. Repository Connection
  2. Verify API endpoints
  3. Check access tokens
  4. Confirm store assignments

  5. Cache Issues

  6. Review cache configuration
  7. Check cache tags
  8. Monitor cache storage

  9. Content Sync

  10. Validate webhook setup
  11. Check repository field values
  12. Review store-specific settings