{{ module.heading }}
{% endif %} {% if module.body_text %}{{ module.heading }}
{% endif %} {# Conditional with else #} {% if module.image.src %}{{ item.title }}
{{ item.description }}
{{ card.card_title }}
{{ module | pprint }}
```
---
## Module Development Best Practices
**1. Use descriptive names for fields.** Field names should be clear and descriptive so that marketing editors understand what content to enter.
**2. Provide default values.** Define default values for all fields so that the module looks good when first added to a page.
**3. Use conditional fields.** Use the `visibility` property to show or hide fields based on the value of other fields, simplifying the editor interface.
**4. Organise fields into groups.** Group related fields into groups to make the editor interface more intuitive.
**5. Use CSS variables for colour customisation.** Instead of individual colour fields, use CSS variables so that the module respects the theme's design system.
**6. Document modules.** Use the `help_text` field in `meta.json` to document the module's purpose and how to use it.
**7. Version modules.** Use version control (Git) to manage changes to modules and facilitate collaboration.
---
## Frequently Asked Questions
**Can I use JavaScript frameworks (React, Vue) in HubSpot CMS modules?**
Yes, it is possible to use React or Vue in HubSpot CMS modules. However, for most use cases, vanilla JavaScript or jQuery are sufficient and have better performance. If you need to use React, consider using HubSpot CMS with a headless approach.
**How many custom modules can I create in HubSpot CMS?**
There is no official limit on the number of custom modules you can create in HubSpot CMS.
**Can I share modules between different HubSpot accounts?**
Yes, you can export modules from one HubSpot account and import them into another. You can also publish modules to the HubSpot Marketplace to share them with the community.
**Do custom modules affect page performance?**
Custom modules can affect performance if they include heavy JavaScript or CSS. Follow performance best practices: minimise CSS and JavaScript, use lazy loading for images and avoid blocking rendering.
**Can I use custom modules in HubSpot emails?**
Yes, you can use custom modules in HubSpot email templates. However, email templates have additional restrictions (JavaScript cannot be used, CSS must be inline).
---
## Conclusion
Custom modules are the most powerful tool in the HubSpot CMS development ecosystem. By mastering their development, you can create content editing experiences that combine the flexibility of custom development with the ease of use that marketing teams need.
At Emovere we specialise in the development of custom modules and themes for HubSpot CMS. If you need to develop custom modules for your HubSpot website, contact our team.
---
## References
[1] HubSpot — Custom Module Documentation. https://developers.hubspot.com/docs/cms/building-blocks/modules
[2] HubSpot — HubL Reference. https://developers.hubspot.com/docs/cms/hubl
[3] HubSpot — CMS CLI Documentation. https://developers.hubspot.com/docs/cms/developer-reference/local-development-cms-cli
[4] HubSpot — Module Fields Reference. https://developers.hubspot.com/docs/cms/building-blocks/module-theme-fields
[5] HubSpot — Design Manager Overview. https://knowledge.hubspot.com/website-pages/get-started-with-the-design-manager



