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.
As 2024 wraps up, the dropshipping landscape is already shifting towards 2025's trends....
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024