Customise quote template in CMS

Hi!

When we creates a child.css from original.html to customise the CMS template, do we need to copy the whole code from original to child and edit from there?

Hi @JLow16 there’s no need to copy the whole code from the original template. The main purpose of the child themes is to be able to modify the parent theme without directly changing or modifying something in the parent theme or the original theme.

You can learn more about child themes here. Child Themes - HubSpot docs

Thank you @felixmacaspac! I am trying to edit the Flow template child theme to allow showing more than one recipient company in the quote when more than one company is associated to the deal. Can you advise the code to use please? I have the below but doesn’t seems to work.

{% set all_companies = quote.associations.companies %}
{% if all_companies|length > 0 %}
<h3>Quote For:</h3>
<p>
{{ all_companies[0].name }}<br>
{{ all_companies[0].address }}<br>
{{ all_companies[0].city }}, {{ all_companies[0].state }} {{ all_companies[0].zip }}
</p>

{% if all_companies|length > 1 %}
<h3>Also Sent To:</h3>
<p>
{{ all_companies[1].name }}<br>
{{ all_companies[1].address }}<br>
{{ all_companies[1].city }}, {{ all_companies[1].state }} {{ all_companies[1].zip }}
</p>
{% endif %}
{% else %}
<p><em>No associated companies.</em></p>
{% endif %}

Hey hey @JLow16 :waving_hand: Have you tried using a for loop instead?

{% set all_companies = quote.associations.companies.items %}
{% if all_companies|length > 0 %}
 <h3>Quote For:</h3>

 {% for company in all_companies %}
 {% if loop.first %}
 <h4>Primary Company:</h4>
 {% else %}
 <h4>Additional Company:</h4>
 {% endif %}
 <p>
 {{ company.name }}<br>
 {{ company.address }}<br>
 {% if company.city and company.state and company.zip %}
 {{ company.city }}, {{ company.state }} {{ company.zip }}
 {% endif %}
 </p>
 {% endfor %}

{% else %}
 <p><em>No associated companies.</em></p>
{% endif %}

Talk soon! — Jaycee

Hey @Jaycee_Lewis :waving_hand:! thanks so much for the advise.

I tried and got the below. I tried creating a quote for a deal that has 2 company associated using the template but can’t get both to show under recipient company.

Hey @JLow16 Did you ever get this worked out? If not, I am happy to test again with you. — Jaycee

hey @Jaycee_Lewis, thank you for checking back. Sadly no, I didn’t manage to get the desired result or CMS output after multiple testing.

Dang it. I’ll make a test and follow up here — Jaycee

Appreciate it Jaycee! I’m editing using the Flow theme child.css, if that’s helpful.

Hey, @JLow16 :waving_hand:

{% set all_companies = quote.associations.companies %}

{% if all_companies|length > 0 %}
 <h3>Quote For:</h3>

 {% for company in all_companies %}
 {% if loop.first %}
 <h4>Primary Company:</h4>
 {% else %}
 <h4>Additional Company:</h4>
 {% endif %}
 <p>
 {{ company.name }}<br>
 {{ company.address }}<br>
 {% if company.city and company.state and company.zip %}
 {{ company.city }}, {{ company.state }} {{ company.zip }}
 {% endif %}
 </p>
 {% endfor %}
{% else %}
 <p><em>No associated companies.</em></p>
{% endif %}

I wonder if this gets us any closer to your goal :thinking: — Jaycee