The Pricing card module is a simple module for the HubSpot CMS that demonstrates how using a repeater and other features of the module system can be used to create a simple editing experience.
Created by: Gregory Cornelius
Tags: Lists, Pricing tables
After receiving a minimum of 25 recommendations, an entry earns the "Community Approved" badge.
Please keep in mind, all entries are community created and may not be fully supported by HubSpot.
View on:
{%- macro inlineDynamicButtonStyles(styleDict) -%}
{%- for prop, value in styleDict.items() -%}
{{ prop|replace('_', '-') ~ ': ' ~ value ~ ( loop.last ? '' : '; ') }}
{%- endfor -%}
{%- endmacro -%}
{%- set buttonStyles = {
background_color: module.button_bg.color,
color: module.button_text_color.color
}
-%}
<div class="card">
<div class="card-header">
<h2 class="card-heading">{{ module.tier }}</h2>
<p class="card-subtitle"> {{ module.description }}</p>
</div>
<hr>
<div class="card-body">
<ul>
{% for feature in module.features %}
<li>
{%- icon
name="{{ module.feature_icon.name }}"
style="{{ module.feature_icon.type }}"
unicode="{{ module.feature_icon.unicode }}"
%}{{ feature }}</li>
{% endfor %}
</ul>
<hr>
<h3 class="card-heading">{{ module.price }}</h3>
<button type="button" style="{{ inlineDynamicButtonStyles(buttonStyles) }}">{{ module.button_text }}</button>
</div>
</div>
/* css */
.card {
box-shadow: 0 0 10px 0 rgba(0,0,0,0.15);
padding: 2rem;
text-align: center;
}
.card button {
display: inline-block;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
border: 0;
border-radius: 6px;
padding: 0.5rem 2.5rem;
}
.card hr {
background: none;
border-top: 1.5px solid #CED4DB;
}
.card-header {
text-align: center;
}
.card-heading {
text-align: center;
}
.card-subtitle, .card-body li {
font-size: 0.9em;
line-height: 1.2em;
}
.card-body ul, .card-body li {
padding: 0;
}
.card-body li {
text-align: left;
padding: 0.25rem 0;
list-style: none;
margin: 0;
}
.card-body svg {
fill: #494A52;
display: inline-block;
max-width: 20px;
margin-right: 10px;
}
@media screen and (max-width: 1200px) {
.card {
padding: 2rem 1rem;
}
}
@media screen and (max-width: 787px) {
.card {
margin-bottom: 1rem;
}
}
The Pricing card module is a simple module for the HubSpot CMS that demonstrates how using a repeater and other features of the module system can be used to create a simple editing experience. The module is part of the HubSpot CMS Theme Boilerplate, so the best way to see the module in action together with other modules is to play around with the boilerplate.
To try out the module in HubSpot, you can leverage the @hubspot/cms-cli to upload the module to HubSpot.
npm install
npx hscms upload "Pricing card.module" "Pricing card.module"
. This will upload the module to the HubSpot Design Manager.A modern framework for accelerating build times on the HubSpot CMS. Based on a modified Bootstrap 4 framework.
Lead developers: Jon McLaren
Chrome/Chromium extension for HubSpot CMS Developers that adds a developer menu, dark theme and useful shortcuts to commonly used HubSpot query parameters, resources, and tools for making HubSpot Development easier and more enjoyable.
Lead developers: Jon McLaren , William Spiro , Gonzalo Torreras
This extension enables super fast local development of CMS pages, and is a great compliment to using the new local HubL server. It contains comprehensive HubL tag, function, filter and expression test auto-complete snippets, as well as their documentation.
Lead developers: William Spiro
Find an entry with an issue, bug, or abuse?
Please complete the below information in detail and we will investigate.
Reporting as Luke Summerfield