Orbe – Help center
PlansPartnersUse CasesSupportChangelog
  • 👋Before starting
    • Welcome
    • How Orbe works
    • Pricing
    • FAQs
  • 🧩GENERAL
    • Install Orbe
    • Refresh Data
    • Connect Stores
      • Redirect to another store
      • Settings
    • Integrations
      • Klaviyo
      • Global-e
      • Connectif
      • Hreflang Manager
      • Announcement Bar
    • Uninstall Orbe
  • 🌐Geolocation Popup
    • Set up Geolocation
    • Translations
    • Common issues
  • 🔁Selectors
    • Overview
    • Geolocation Button
      • How it works
      • Selector Placement
      • Variables
      • Custom Code
    • Market Selector
  • ⚙️Settings
    • Notifications
    • Behavioral Preferences
    • Custom CSS
  • Developer Reference
    • CSS
    • JavaScript
    • Relocating the Market Selector
    • Integrate your selector
    • Snippets
      • Create a full-screen popup
      • Country Order Customization
      • Language Order Customization
      • Hide the popup in a country
      • Change popup fonts
      • Hide countries
Powered by GitBook
On this page

Was this helpful?

  1. Developer Reference
  2. Snippets

Language Order Customization

PreviousCountry Order CustomizationNextHide the popup in a country

Last updated 1 year ago

Was this helpful?

In Orbe, the language list within the selector is ordered by default according to how it's being added to Shopify. However, it's possible to customize this order using CSS, allowing you to prioritize certain languages by placing them at the top of the list.

For example, in this language selector, you can see that Dansk and Italian are at the top when you open the selector:

Here's a step-by-step guide on how to achieve this through Custom CSS:

Step 1: Modify the display of the list

To start, we need to change the display setting of the language list to a grid layout. This allows us to reorder the languages:

.md-form__select__language__list {
    display: grid;
}

.md-form__select__language__list[hidden] {
    display: none;
}

Step 2: Set Default Order

Next, set a default order for all languages in the list. This ensures that any language not explicitly reordered will follow this default setting:

.md-form__select__language__list li {
    order: 2;
}

Step 3: Reorder Specific Languages

Now, you can select specific languages and assign them a different order. In this example, we're moving English (EN) and Spanish (ES) to the top of the list:

.md-form__select__language__list li[data-locale="it"], 
.md-form__select__language__list li[data-locale="da"] {
    order: 1;
}

Adding these CSS classes allows you to customize the order of languages within the Orbe selector easily. Just replace "it" and "da" with the language codes of your preferred languages to tailor the list to your needs. This refers to the ISO two-letter code (alpha-2) of the language.

Complete Code Example

Here's the complete CSS snippet for repositioning Italian and Dansk at the top of the list:

.md-form__select__language__list {
    display: grid;
}

.md-form__select__language__list[hidden] {
    display: none;
}

.md-form__select__language__list li {
    order: 2;
}

.md-form__select__language__list li[data-locale="it"], 
.md-form__select__language__list li[data-locale="da"] {
    order: 1;
}

With this customization, you can enhance the user experience by highlighting the most relevant languages for your customers.