Skip to content

Instantly share code, notes, and snippets.

@bill-barron
Last active August 29, 2015 14:28
Show Gist options
  • Save bill-barron/da53b0a1030d32325ed0 to your computer and use it in GitHub Desktop.
Save bill-barron/da53b0a1030d32325ed0 to your computer and use it in GitHub Desktop.
Replace the GUID of a Sitecore media item with that item's url -- Works in Notepad++ with the Python Script plugin installed. Converts 32-bit GUID like this {01234567-89AB-CDEF-0123-456789ABCDEF} into a url like this http://www.example.com/~/media/0123456789ABCDEF0123456789ABCDEF.ashx
editor.pyreplace(r"\{([0-9a-fA-F]{8})-([0-9a-fA-F]{4})-([0-9a-fA-F]{4})-([0-9a-fA-F]{4})-([0-9a-fA-F]{12})\}", r"http://www.example.com/~/media/\1\2\3\4\5.ashx")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment