CMS Development

Aimartinez14
メンバー

HTML and CSS code of the "Modern" Style Template

Hi there!

 

We are developing our own template, based on the CCS and HTML from the "Minimal Template".

 

We are now wondering if it could be possible to get the code from the "Modern Template"...

 

It is the template that we have been using lately, and we would like to keep our own development similar, basing our edited style without changing it too much from the previous template.

 

We also got the "Bold Template", but we do not need it.

 

Many thanks in advance!

0 いいね!
10件の返信
JLaurrieta
投稿者

HTML and CSS code of the "Modern" Style Template

I don't think there's such option; it's either percentage or currency.

After printing out all the available properties, I just assume they've just made Total - Subtotal to get the currency value of the fee. 

It is a dirty sollution, I know but it will always work.

JLaurrieta
投稿者

HTML and CSS code of the "Modern" Style Template

Hi tanyaunangst

Just tried it myself. It's fairly simple. I could check your code to make sure, but I'm guessing you're missing part of the example code. 

 

 {% for fee in ADDITIONAL_FEES %}
                <tr>
                  <td>
                    {{ fee.name }}
                  </td>
                  <td>
                    {{ fee.category == "DISCOUNT" ? "-" : null }}
                    {% if fee.isPercentage %}
                      {{ fee.amount }} % / {{ fee.value|format_currency(LOCALE, CURRENCY, true)}}
                    {% else %}
                      {{ fee.amount|format_currency(LOCALE, CURRENCY, true)}}
                    {% endif %}
                  </td>
                </tr>
                {% endfor %}

 

You were missing the FOR in your example code; without it, the machine won't know what "fee" references to.

Regards

0 いいね!
tanyaunangst
参加者

HTML and CSS code of the "Modern" Style Template

@JLaurrieta thank you but I just did not include the FOR loop in my question because it is irrelevant to what I'm asking.  If I print out fee.amount it is 8 which is the percentage.  On the Modern, Standard, and Basic templates even when the tax is setup as a PERCENTAGE not an amount, the AMOUNT prints on the form.  So what I'm asking is... in ADDITIONAL_FEES, what is the tax dollar amount?  fee.amount = the percentage.  fee.WHAT? equals the dollar amount??  I've shown all of this in the screenshots of my post above.  

 

0 いいね!
tanyaunangst
参加者

HTML and CSS code of the "Modern" Style Template

In case anyone else comes along who knows about tax on a quote, I'll try to clarify what I'm looking for.  I wonder if the Standard, Basic, and Modern calculate the tax for display as an amount?  If you build a quote and select a percentage for the tax, say 8%,

Screen Shot 2021-11-01 at 2.18.28 PM.png

the Standard Basic and Modern quote templates do not display the 8%. They show the $359.60 amount like this:

Screen Shot 2021-11-01 at 2.19.06 PM.png

But if you use the "Minimal" template that is provided in cms-quotes-theme, it shows as a percentage (8%).  
Screen Shot 2021-11-01 at 2.30.02 PM.png

Since cms-quotes-theme is my only resource I don't know how the other templates are showing the amount instead of the percentage.  If anyone knows that, please let me know.

Otherwise I guess I will pursue trying to calculate that amount it in my template.  

0 いいね!
tanyaunangst
参加者

HTML and CSS code of the "Modern" Style Template

@JLaurrieta thank you!  That does work for discounts.  Have you ever displayed a tax amount instead of the tax percentage?  
The code in the line-items table is like this below.  And taxes have the is_percentage flag so the fee.amount is the percentage.  On the Modern template the tax prints as the dollar amount instead of the percentage but I haven't been able to figure out where that value is.  Do you know if there's somewhere to see what are all the fields associated with a fee?  I haven't been able to find that.  
{% if fee.is_percentage %}
{{ fee.amount }} %
{% else %}
{{ fee.amount|format_currency(LOCALE, CURRENCY, true)}}
{% endif %}

0 いいね!
JLaurrieta
投稿者

HTML and CSS code of the "Modern" Style Template

Hi

To get all available properties you can put the following code in your template:

{{ QUOTE_PROPS|pprint }}

 Nevertheless, I'm not sure of what you're after. When making a quote, you have the option, in the 4th step, to add taxes either in percentage or currency (see picture bellow).

JLaurrieta_0-1635793129074.png

What the code you shared is doing is just checking whether that information has been added as percentage or currency. I'm just guessing that if you copy the line from the Else in the If you'll get the value as currency in both cases

{% if fee.is_percentage %}
{{ fee.amount }} % / {{ fee.amount|format_currency(LOCALE, CURRENCY, true)}}
{% else %}
{{ fee.amount|format_currency(LOCALE, CURRENCY, true)}}
{% endif %}

Have't checked it myself, but I guess that'll be the case.

Hope it helps

0 いいね!
JLaurrieta
投稿者

HTML and CSS code of the "Modern" Style Template

Hi Tanyaunangst

We didn't get it, unfortunatelly. Still, if what you're after is item discount, you can try {{item.discount}} instead of  {{ item.hs_discount_percentage }}, where item is each item in template_data.quoteAssociatedObjects.lineItems.

it works for me

tanyaunangst
参加者

HTML and CSS code of the "Modern" Style Template

Did anyone get the html for the Modern template?  I'd like to see how they are getting the tax amount to display as a value instead of a percentage in the line items table.  The other templates don't do it that way.  

0 いいね!
jonchim
ガイド役 | Diamond Partner
ガイド役 | Diamond Partner

HTML and CSS code of the "Modern" Style Template

Hey @Aimartinez14 ,

If the "minimal template" theme is a cloned version you should be able to take the css and html from the "modern template" and copy and paste it into your "minimal template" theme. However i'm not sure if the settings in theme settings will transfer over if themes got updated.






Jon Chim
VP of Design & Development
Hypha HubSpot Development


check Did my post help answer your query? Help the Community by marking it as a solution
JLaurrieta
投稿者

HTML and CSS code of the "Modern" Style Template

Hey @jonchim ,

CSS and HTML would be fine if it were only the aesthetics you were after. The problem is you don´t get the template variables that way, which forces you to somewhat rudimentary solutions when trying to get variables such as senders avatar image (available in Modern, as far as I know), or quote creator first and last name. Templates are usful for the variables they hold, not just the aesthetics...

thanks any way

regards

0 いいね!