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.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024