Skip to content

Instantly share code, notes, and snippets.

@steven-miller
Created June 12, 2019 00:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steven-miller/5cd66736d51c6e87fb35bce1f1b598d2 to your computer and use it in GitHub Desktop.
Save steven-miller/5cd66736d51c6e87fb35bce1f1b598d2 to your computer and use it in GitHub Desktop.
Pre-filled content options for HubSpot modules
<!--
Dropdown Option Area
- before adding a new section, you need to add a new option to the "Prebuilt Modules" field on the right side
- keep in mind that the "content" section may require HTML / styling, so it may be worth tinkering with in the module tester on "custom" setting before adding new options to the dropdown
-->
{% if module.prebuilt_modules == "option_a" %}
{% set custom_values = {
'title': 'Title A',
'button_image': {
'src': 'https://cataas.com/cat',
'alt': 'static cat'
}
}
%}
{% elif module.prebuilt_modules == "option_b" %}
{% set custom_values = {
'title': 'Title B',
'button_image': {
'src': 'https://cataas.com/cat/gif',
'alt': 'active cat'
}
}
%}
{% endif %}
<!-- actual module area -->
{% if module.prebuilt_modules == "custom" %}
{% if module.title %}
<h1 class="title"><span class="title1">{{ module.title }}</span></h1>
{% endif %}
{% else %}
{% if custom_values.title %}
<h1 class="title"> <span class="title1">{{ custom_values.title }}</span></h1>
{% endif %}
{% endif %}
{% if module.prebuilt_modules == "custom" %}
{% if module.button_image.src %}
<img width="{{ module.button_image.width }}" height="{{ module.button_image.height }}" src="{{ module.button_image.src }}" alt="{{ module.button_image.alt }}" >
{% endif %}
{% else %}
{% if custom_values.button_image.src %}
<img src="{{ custom_values.button_image.src }}" alt="{{ custom_values.button_image.alt }}" >
{% endif %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment