Components
The Components tool provides access to your site’s reusable components, allowing you to list components, retrieve their content and properties, and update localized versions for multi-language sites.
When to use
Use the Components tool to:
- List all components: Get an overview of reusable components in your site
- Inspect component structure: View component content, elements, and nesting
- Manage localization: Update component content and properties for different languages
- Audit components: Check component usage and configuration
- Update translations: Modify text and properties in secondary locales
Tool details
Tool name: data_components_tool
Available actions
List components
List all components in a site with metadata including IDs, names, and versions.
Action: list_components
Parameters:
Returns: Array of components with metadata
Example usage:
Get component content
Retrieve the complete content structure for a component including text, images, and nested components.
Action: get_component_content
Parameters:
Returns: Complete component content structure
Example usage:
Use this to understand what text nodes and elements exist in a component before making localization updates.
Update component content
Update content on a component in secondary locales by modifying text nodes and property overrides.
Action: update_component_content
Parameters:
Example usage:
This action only works with secondary locales. You cannot update the primary locale using this tool.
Get component properties
Retrieve component properties including default values and configuration settings.
Action: get_component_properties
Parameters:
Returns: Component properties with values and configuration
Example usage:
Update component properties
Update component properties for localization to customize behavior in different languages.
Action: update_component_properties
Parameters:
Example usage:
Best practices
Understand component structure before updates
Always use get_component_content before making updates to understand the component’s structure, text nodes, and nested elements.
Use consistent localization
Maintain consistent terminology across components in the same locale. Create a translation glossary to ensure consistency.
Test component instances
After updating a component, verify that all instances of that component throughout your site display correctly.
Handle nested components carefully
When components contain other components, update the parent and child components separately. Nested content may require individual localization.
Version control for major changes
Before making significant component updates, document the current state or create a backup. Component changes affect all instances site-wide.
Limitations
- Secondary locales only: Content and property updates only work with secondary locales
- Component structure: Cannot change component structure (add/remove elements) via Data API