Showing different section based on selected language.

Topic summary

A user working with Shopify’s Horizon theme wants to display different sections based on the selected language (Arabic and English) for a single market.

Initial Approach:

  • Attempted using {% if %} statements in theme.liquid, but couldn’t locate the appropriate placement in the Horizon theme.

Suggested Solutions:

  1. Multiple Markets (Recommended): Create separate markets for each language to configure different sections through Shopify’s Customizer. This provides cleaner management for complex differences.
  2. CSS Hiding: Use the lang attribute in HTML (e.g., [lang="en"]) to selectively hide/show elements with CSS display properties.

Current Blocker:
Shopify doesn’t allow creating multiple markets for the same country, preventing the recommended multi-market approach.

Status: The discussion remains open with an unresolved question about the best implementation method given Shopify’s market limitations.

Summarized with AI on October 27. AI used: claude-sonnet-4-5-20250929.

Hello,

I have been trying to hide some sections and show others based on the selected language. I have looked into this, and many have suggested that the best option is to use {% if %} {% endif %}. However, everyone I’ve seen had {% style %} in their theme.liquid where they could place the {% if %} {% endif %} there. But, for me, in the Horizon theme, that doesn’t work; I can’t seem to find where I can add the code.

Any help would be appreciated. Thanks.

I’d say you should have different markets and then use built-in tools to have different sections configured in Customizer for each market.

This is how it supposed to be.

However, you can also do some hiding with CSS.

Most themes produce this as the first line of HTML code:


So you can have CSS selector using this parameter, for example like this:

[lang="en"] cart-drawer-component {
  display: none;
}

The code will hide the cart icon in the header for english version of the site…

1 Like

So, is it better to create a new market for the other language instead of adding the language to the current market? I’m selling in only one market currently, but I want to add support for both Arabic and English.

I would say yes. It would make it much easier to configure your pages for different languages.

This however, depends on how complex the differences are – for small differences the “hiding” approach may work too.

I really appreciate your help. But one more thing, now when I tried to do this, Shopify doesn’t allow me to create two markets for the same country. So, what’s the best approach to implement this?