Skip to main content

I’m not sure whether anybody else has come across this or if it is even possible.

 

I am trying to change the contents of a buttons URL based on the profiles $locale.

Based on the 2 country code, I want to direct them to a different website.

Is this possible?

@NBiff in order to accomplish what you are describing you will need to script it via Django and HTML logic.

You add a HTML block and in the code section like below:

{% if profile.locale == "en" %}
<a href="https://example.com/en-signup"
style="display:inline-block; padding:12px 24px; background:#000; color:#fff; border-radius:6px; text-decoration:none;">
Subscribe Now
</a>
{% elsif profile.locale == "it" %}
<a href="https://example.com/it-iscriviti"
style="display:inline-block; padding:12px 24px; background:#000; color:#fff; border-radius:6px; text-decoration:none;">
Iscriviti Ora
</a>
{% elsif profile.locale == "fr" %}
<a href="https://example.com/fr-inscription"
style="display:inline-block; padding:12px 24px; background:#000; color:#fff; border-radius:6px; text-decoration:none;">
Inscrivez-vous
</a>
{% else %}
<a href="https://example.com/global-join"
style="display:inline-block; padding:12px 24px; background:#000; color:#fff; border-radius:6px; text-decoration:none;">
Join Us
</a>
{% endif %}

 


Thank you ​@whereisjad