Contentful Naming Convention Guide
This document provides a comprehensive guide on the naming conventions adopted for content types within our Contentful projects. Adhering to these conventions ensures consistency, clarity, and efficiency in managing and identifying content across our projects.
Overview
Our naming convention is a systematic approach for naming content types, which includes both ‘Content Types’ and ‘Components’. It incorporates the project identifier, type categories, component names, and optionally, event names. Each element within a name is separated by a ”>” sign, providing a clear hierarchy and context.
Content Types Naming
For content types, our naming convention follows this structure:
Project > Type Category > Component Name
- Project: Always prefix with the project acronym (e.g., NCR is short of Ncremental).
- Type Category: Specify the type category, such as Pages, Components, Restrictions, Logs, etc.
- Component Name: The name of the component, using space-separated words.
Example:
NCR > Pages > Home
NCR > Components > Header
Components Naming
For components, the naming convention is slightly different to include more specific details:
[Component Page] Type of cComponent > Component Name (Optional: Event Name)
- Component Page: The page on which the component is located.
- Type of Component: Specify the type of the component in brackets (e.g., [Banner]).
- Component Name: The name of the component.
- Event Name (Optional): If applicable, an event name can be added in parentheses at the end.
Example:
[Homepage] Banner > Top Banner (Black Friday)
Tips for Effective Naming
- Be consistent: Use the same format and punctuation for all names.
- Keep it clear: Ensure the name provides enough information about the content type or component.
- Use specific names: Avoid generic names that could apply to multiple components or content types.
Notes and Warnings
The following regexes can be used to match the component type names and the component names respectively. Both are configured by default when using Ncremental Toolkit types.
\[[\w\s]+\](\s[\w\s]+>?){2}(\([\w\s]+\))?$
^([\w\s]+>){2}[\w\s]+$
Remember to update the naming conventions documentation if any changes are made to the naming strategy to keep everyone aligned.
Avoid using special characters or emojis in names, as they may not be supported by all systems and can create confusion.
Conclusion
Following these naming conventions will streamline content management and improve collaboration across teams. If you have any questions or need further clarification, please reach out to the content management team.