HubSpot CMS for Developers flashcards
HubSpot CMS for Developers · Build recall with a focused review session.
33 cards. Read the term and the definition here. The deck at the top of this page is optional.
- HubL delimiters
- HubL uses {% %} for logic tags such as if, for, and set, and {{ }} for output expressions. Comments use {# #}. Filters are chained with the pipe character inside output tags.
- hs watch command
- The HubSpot CLI command hs watch uploads local file changes to the connected portal continuously. It requires prior authentication via hs init and a configured portal in the project's hubspot.config.yml.
- Local module meta.json
- meta.json defines a module's fields, labels, defaults, and help text. Local modules store this file inside the theme and cannot be edited through the design manager UI.
- Drag-and-drop area tag
- The {% dnd_area "name" %} tag declares an editable region. It contains {% dnd_section %} blocks, which contain {% dnd_module path="..." %} or {% dnd_column %} children for layout control.
- Module field access
- In templates, local module values are read as module.field_name. In drag-and-drop contexts values appear under widget_data.field_name. Defaults from meta.json apply when unset.
- Repeating field groups
- A group field with occurrence settings enabled lets editors add multiple sets of subfields. Templates iterate the group with a for loop over module.group_name.
- HubDB row query
- hubdb_table_rows(table_id, query) returns rows from a HubDB table. The query string supports column filters and orderBy clauses. hubdb_table_row fetches a single row by ID.
- Dynamic pages with HubDB
- A dynamic page binds a HubDB table to a template and a URL route using a column such as slug. Each row renders as its own page through the same template.
- Serverless function route
- Files in .functions/ export an async main function. They are served at /_hcms/api/<route>. Secrets are configured in the portal and read via process.env.
- Forms API submission endpoint
- POST to api.hsforms.com/submissions/v3/integration/submit/{portalId}/{formGuid} submits form data. The payload includes fields, context, and legalConsentOptions for consent capture.
- CMS Pages API
- The CMS Pages API at api.hubapi.com/cms/v3/pages manages site pages with create, read, update, and publish operations. Draft and publish states are controlled separately.
- Blog API
- The HubSpot Blog API manages blog posts, authors, and settings under cms/v3/blogs. Posts support draft and publish states and require a content group for organization.
- content object
- Templates access page data through the content object, including title, body, absolute_url, featured_image, and canonical_url. These values reflect the current page being rendered.
- Personalization tags
- HubSpot personalization renders contact data such as {{ contact.firstname }} only for known contacts. Anonymous visitors see fallback defaults, so templates must guard with {% if contact %}.
- Theme structure
- A HubSpot theme contains theme.json for config and metadata, templates/ and modules/ folders, plus css/ and js/ assets. Themes are the deployable unit for marketplace distribution.
- Partial include
- The {% include "path" %} tag renders another template inline. {% module "path" %} renders a module. Both support passing parameters for reusable fragments.
- System templates
- HubSpot uses system templates for 404, password-protected pages, search results, and email subscription pages. Each can be overridden by assigning a custom template.
- HubL filters
- Filters transform output values, for example truncate, default, escape, and format_date. They are applied with the pipe character inside output tags and can be chained.
- Template types
- HubSpot supports page templates, blog listing and post templates, system templates, and email templates. Each type is selected when creating or editing content.
- hs create command
- The CLI command hs create scaffolds new templates, modules, or themes in the local project. It offers interactive prompts for type and name, then writes files to disk.
- hs fetch command
- hs fetch downloads remote portal files into the local project. It is used to bring existing templates or modules under local version control before editing.
- Module CSS and JS
- A local module can include module.css and module.js alongside module.html. These assets are scoped to the module and loaded when the module renders on a page.
- HubDB column types
- HubDB columns support text, number, date, boolean, select, location, and foreign ID types. Foreign ID columns reference rows in another table for relational data.
- HubL for loop
- The {% for item in sequence %} tag iterates arrays such as blog posts or HubDB rows. Loop variables like loop.index and loop.first are available inside the body.
- URL redirects
- Redirects are managed in Settings or through the URL redirects API. They map old paths to new ones and support 301 and 302 status codes for SEO continuity.
- Canonical URL
- The canonical URL is exposed as content.canonical_url and signals the preferred page version to search engines. It helps consolidate duplicate content across routes.
- Image field rendering
- Image fields return an object with src, alt, width, and height. Templates render them with the img tag and should include alt text and explicit dimensions for layout stability.
- Menu field
- A menu field references a navigation menu configured in portal settings. Templates render it by looping over the menu's children and outputting each item's URL and label.
- Choice field
- A choice field presents selectable options defined in meta.json, each with a label and value. Templates compare module.field_name to the stored value in conditionals.
- Rich text field
- A rich text field stores HTML edited in the WYSIWYG editor. Templates output it directly, and content editors can add formatting, links, and embedded media without code changes.
- Template inheritance
- HubSpot templates can extend a base layout using {% extends "base.html" %} and {% block %} tags. This shares headers and footers across many page templates.
- hs upload command
- hs upload pushes a specific file or folder to the portal once. Unlike hs watch, it performs a single transfer and exits, useful in deployment scripts.
- Spam protection
- HubSpot forms include built-in spam filtering. Developers can add reCAPTCHA or honeypot fields, and serverless endpoints should validate input before writing to the CRM.