HubSpot CMS

Pricing card module

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.

Unverified
?

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.

2 Recommendations

View on:

GitHub

HTML + HUBL
{%- 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
          
            /* 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;
  }
}
          
        
JS
          
            
          
        
Have Questions?

Ask technical questions in Slack.

HubSpot Developer Slack

Not a member yet? - join here
READ ME (VIEW IN GITHUB)

HubSpot CMS Pricing card module

Pricing card screenshot

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.

Getting started

To try out the module in HubSpot, you can leverage the @hubspot/cms-cli to upload the module to HubSpot.

  1. Run npm install
  2. Set up your hubspot.config.yml if you haven't already to configure the CLI so that you can upload files to the HubSpot portals that you use
  3. Run npx hscms upload "Pricing card.module" "Pricing card.module". This will upload the module to the HubSpot Design Manager.
 
2 Recommendations

Other Open Source Projects

Browse all other open source projects

CrankShaft Framework

A modern framework for accelerating build times on the HubSpot CMS. Based on a modified Bootstrap 4 framework.

Lead developers: Jon McLaren

Developer Chrome Extension

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

VS Code HubL Language Extension

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

Not coding on HubSpot CMS yet?

We invite you to explore why thousands of developers LOVE coding with HubSpot!

Contribute
Made with  by community members: InboundLabs.co