HTML is not rendered

So I have this code that should display the pricing depending on what the user selected.
( I am using alpine.js to do so)
Everything on the JS sid is working as expected except, however the side that is initialy set to display non is always empty:

Template:

          <div class="pricing-ammount" x-show="monthlySubscription === true">
              {{- $plans.price_monthly  |  safeHTML  -}}
          </div>
          <div class="pricing-ammount" x-show="monthlySubscription === false">
            {{- $plans.price | safeHTML  -}}
          </div>

This is how it is rendered

<div class="pricing-ammount" x-show="monthlySubscription === true" style="display: none;"></div>
<div class="pricing-ammount" x-show="monthlySubscription === false">49<span>€</span> <small>per month</small></div>

“This is how alpinejs renders it”. So what is the problem? This is probably a problem with your alpinejs-implementation, not with Hugo.

Check the source code (not the rendered HTML). It should show up properly.

Yes thank you, have spend a few hours just to find out its a typo! price_monthly vs. price_montly

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.