@hubspot folder, navigate to the cms-quotes-theme folder. Within the templates folder, view the basic.html, modern.html, or original.html templates. These templates contain the following code block at the top:
mock_data.html file, then is set to the QUOTE variable to use the data found in template_data if available. The QUOTE variable is also used to populate the other variables in this list, such as ASSOCIATED_OBJECTS, to make accessing that data less verbose. However, you can structure your data differently, depending on your preferences.
In the above code, you’ll notice that template_data is also used to set the main QUOTE variable. template_data is an object containing all of the actual data for the quote and deal in the page. If that object is not found in the template, HubSpot loads the data from mock_data.html instead.
Template data object
The majority of quote data can be directly accessed through thetemplate_data object. You can use {{ template_data|pprint }} in your template to see the full object provided.
Quote variables
The information specific to an individual quote. Each variable below should be prepended withtemplate_data.. For example: template_data.quote
Associated objects
In a quote template, you can access data from a quote’s associated records, such as deals or companies, by usingassociated_objects.
For example, you can add the logo from the quote recipient’s associated company record to a quote by using the following code:
if statement, the template displays that logo, if available. If no logo has been manually set for the company, no logo is displayed.
Custom objects
Custom object data can be displayed or used within a quote in a couple different ways. Because each custom object’s structure may vary, you’ll need to get specific properties based on how you’ve structured your custom object. The quotetemplate_data by default has custom associated objects in it. For example, custom objects associated with deals are included.
To access them, you can use the following code:
Because custom objects are unique to each account, the mock data doesn’t include an example custom object. This means that in the template preview in the design manager you may see an error or the custom object data simply won’t display. You’ll instead need to preview the template with your real CRM data, which you can do by creating a quote from the template.
template_data.quote.associated_objects.deal.associated_objects.custom_objects._2_2193031
You can also look up a custom object by using the crm_associations() function and crm_objects() functions.
For example, if you wanted to look up a custom object associated with a deal, you could pass in data from template_data: