Give a HubSpot custom module a unique ID
Technical Difficulty: Advanced
Written by Stephanie O'Gay Garcia
First Published: March 12, 2020
Last Updated: March 12, 2020
⚠️ Note that this post hasn't been updated for at least a year and the information may be outdated, proceed with caution! (Last updated: March 12, 2020)
Sometimes you may want to use a unique ID for a custom module. You can create an ID using the following HubL snippet:
{% raw %}{% set mid = module | pprint | md5 %}
Then you can use that ID to create a unique CSS ID, for example:
`
My DIV
`
which will print out something like:
`
My DIV
`
If you found this helpful, buy me a coffee! ❤️