App reviews, troubleshooting, and recommendations
Hi!
I want to insert an inline form on my blog with the 'Forms' app, but I have different languages, using the 'Markets' feature and the 'Translate and Adapt' app.
I have created 5 different forms for 5 languages (EN, DE, FR, IT, ES), each with their own ID.
Is there a liquid tag for Forms, per ID, that I could easily insert in my article template code? This is what it looks like now:
{% assign locale = request.locale %} {% if locale == 'en' %} {% render 'form-EN' %} {% elsif locale == 'de' %} {% render 'form-DE' %} {% elsif locale == 'fr' -%} {% render 'form-FR' %} {% elsif locale == 'it' -%} {% render 'form-IT' %} {% elsif locale == 'es' %} {% render 'form-ES' %} {% else %} {% render 'form-EN' %} {% endif %}
I would like to use a Forms liquid tag that I can write in my different 'form-language' snippets, but I can't find a solution.
Thanks in advance!
P.S.: I know I could install other translation or forms apps, but that would add some complexity and costs so it's not ideal.
Certainly! To achieve this, you can use the `{% form 'form-ID' %}` liquid tag in your code. Here's how you can modify your template:
```liquid
{% assign locale = request.locale %}
{% form 'form-' | append: locale %}
```
This assumes that your form IDs are constructed as 'form-EN', 'form-DE', etc. The `append` filter will concatenate 'form-' with the current locale, giving you the correct form ID dynamically.
This simplifies your code and makes it more scalable, especially when adding more languages in the future.
This is not working, and also the form ID is assigned automatically there's no way to edit it.
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024