Recommendations: Working with data sources and media
Organizing and naming your data sources and media items wisely can make a world of difference for your editors. This topic describes some best practices for dealing with data sources and media items in SXA.
Clean up unused data sources
Remove unused site data sources. Keeping unused site data sources in the site introduces the following risks:
-
Your editors can use them by accident.
-
Your editors might not be able to find a more suitable piece of content that you intend them to use.
This recommendation applies to site/global/shared data sources and is not necessary for the data sources stored under the Data folder under your page.
Do not put media items directly under the site's Media folder
The Media folder in SXA sites (sitecore/Content/Tenant/Site/Media) is a scoped view of the Media Library items available for the site. You must not upload Media items to this folder. Instead, use the general Media Libary folder (sitecore/Media Library).
From SXA version 1.7 and higher, you cannot upload media items under the Media item of your site.
Give site data sources meaningful names
Always use meaningful names for your data sources that you use across sites. Think of a name that indicates its purpose so that editors can identify and reuse them. A name such as Carousel 1 does not encourage reusability. However, Hero Carousel for Christmas 2018 does.
This recommendation applies to the site/global/shared data sources and is not necessary for the data sources stored under the Data folder under your pages.
Organize site data sources in folders
Site data folders are expected to host reusable content and it is best practice to keep them uncluttered. Group them in subfolders as needed so that your editors can easily locate and repurpose content that is meant to be reusable.
This recommendation applies to site/global/shared data sources and is not necessary for the data sources stored under the Data folder under your page.
Run source field reports to help set the data source context
Most SXA renderings are designed for reusability and to pull data from data source items. This means that the content they display is not bound to the page on which they appear but is stored in data source items. The Source field specifies where the user is allowed to look for the data source.
Setting this location correctly makes selecting data sources much easier because, for example, the Content Editor is directed to a specific site subfolder and does not have to search the whole Media Library for an image. You can set the location manually, use a query, or use the Source field report helper script.