Automate Your Sitecore Dictionary Entries with PowerShell
- Cristina Paolillo
- Jun 19, 2024
- 1 min read
Updated: Dec 18, 2024
Are you looking to streamline your dictionary entries in Sitecore? Use this PowerShell script designed to simplify bulk insertions and updates.
Here’s how you can use it:
Preparing Your CSV File
Start by creating a CSV file with the following columns:
path: The parent item path (e.g., /sitecore/content/<Site Collection>/<Site>/Dictionary/<Parent Folder Path>)
name: Dictionary item name
key: Dictionary key field
value: Dictionary phrase field
lang: Language
You can download a sample CSV from this link.
How the Script Works
Each entry in your CSV corresponds to a dictionary entry to be inserted or updated:
If the specified path doesn't exist, the script will create it recursively.
If the dictionary item already exists, it will be updated while retaining the previous version.
Uploading to Media Library
Once your CSV file is ready:
Navigate to the media library item at /sitecore/media library/Dictionary (or any preferred path) and upload the file. Just remember to update the file path in the script accordingly.
For future updates, click on "Attach" and update the item with your newly created CSV.
Running the Script and Verifying Results
Access PowerShell ISE from the utilities
Copy the script below
Click on "Execute" to run the script
After execution, verify the correct insertion of dictionary labels.
By following these steps, you can efficiently manage your dictionary entries in Sitecore.
Happy scripting!
Comments