Emergency

In urgent situations or outages, you can send a text message to our emergency line

Emergency line (text message only)

+45 29 70 15 95

Send a text message with the following information:

  • Your name and webshop
  • A description of the problem

Note: This service is only for critical situations where your webshop is down or has serious problems. For regular support, please use our normal support channels.

Accordion layout for theme settings in Shoporama

Shoporama's theme settings now support an accordion layout, a modern way to organize a large number of settings. With search, localStorage memory, and chevron icons, theme developers get a much better overview. Learn how to enable it in your theme.

Reading time: approx. 15 min

What is the accordion layout?

When a Shoporama theme has many theme settings, the classic card layout with a sidebar can quickly become hard to navigate. The accordion layout solves this by organizing all sections into collapsible panels that can be opened and closed individually. This gives the store owner a clean, focused overview, even with 15+ sections.

The Montana theme, Shoporama's newest theme built on Tailwind CSS, uses the accordion layout with no fewer than 16 sections and is the perfect example of how it works in practice.

Accordion vs. classic layout

There are two layout options for theme settings in Shoporama:

  • Classic layout — A two-column layout (9+3 columns) with Bootstrap cards and a sidebar with scroll-spy navigation. Well suited to themes with few sections.
  • Accordion layout — A centered single-column layout with collapsible sections, search, and localStorage. Ideal for themes with many sections and fields.

How to enable the accordion layout

All you need to do is add "accordion": true to your theme's theme_settings.json file. The file is located in the root of your theme.

{
  "info": "My Theme",
  "accordion": true,
  "settings": [
    ...
  ]
}

Without this line, or with "accordion": false, the classic card layout is used automatically.

Features of the accordion layout

The accordion layout comes with a number of features that make it easy to navigate theme settings:

  • Collapsible sections — Each section can be opened and closed with a click. Chevron icons clearly show whether a section is open or closed.
  • Search — A search field at the top filters sections and fields in real time. Matching text is highlighted, and only relevant sections are shown.
  • Remembers state — Which sections are open or closed is saved in localStorage, so the store owner doesn't have to start over on the next visit.
  • Centered layout — The content is shown in a single column (col-lg-10), which gives each field more room and removes the need for sidebar navigation.

The structure of theme_settings.json

The theme_settings.json file defines the entire structure of the theme settings. Here is a complete example inspired by the Montana theme:

{
  "info": "Montana",
  "accordion": true,
  "features": [
    "Responsive design based on Tailwind CSS",
    "Fully customizable colors, logo, and favicon",
    "USP bar with customizable icons in the header"
  ],
  "settings": [
    {
      "path": "general",
      "name": "General",
      "description": "Payment and shipping methods plus delivery times.",
      "fields": [
        {
          "path": "payment_methods",
          "name": "Payment methods",
          "description": "Comma-separated list, e.g.: dankort,visa,mastercard",
          "type": "string"
        },
        {
          "path": "shipping_time_in_stock",
          "name": "Delivery time (in stock)",
          "description": "E.g.: 1-3 business days",
          "type": "string"
        }
      ]
    },
    {
      "path": "theme",
      "name": "Theme & Colors",
      "description": "Colors, logo, and favicon for your store.",
      "fields": [
        {
          "path": "primary",
          "name": "Primary color",
          "description": "Used for text, headings, and dark elements.",
          "type": "color",
          "default_value": "#111827"
        },
        {
          "path": "action",
          "name": "Action color",
          "description": "Used for buttons, links, and CTA elements.",
          "type": "color",
          "default_value": "#2563eb"
        },
        {
          "path": "background",
          "name": "Background color",
          "description": "The page background color.",
          "type": "color",
          "default_value": "#ffffff"
        }
      ]
    },
    {
      "path": "value_propositions",
      "name": "USPs",
      "description": "Up to 4 short messages in the header.",
      "fields": [
        {
          "path": "text_1",
          "name": "USP #1 - Text",
          "type": "string"
        },
        {
          "path": "icon_1",
          "name": "USP #1 - Icon",
          "type": "list",
          "values": [
            { "value": "", "name": "(None)" },
            { "value": "truck", "name": "Truck" },
            { "value": "check", "name": "Checkmark" },
            { "value": "star", "name": "Star" }
          ]
        }
      ]
    },
    {
      "path": "shipping_alert",
      "name": "Shipping alert",
      "description": "Order before 2 PM and we ship today.",
      "fields": [
        {
          "path": "enable",
          "name": "Enable",
          "type": "bool"
        },
        {
          "path": "time",
          "name": "Cutoff time",
          "description": "Time of the last dispatch, e.g. 14:00",
          "type": "string"
        },
        {
          "path": "days",
          "name": "Shipping days",
          "description": "Weekday numbers: 1=Mon, 7=Sun. E.g.: 1,2,3,4,5",
          "type": "string"
        }
      ]
    },
    {
      "path": "product",
      "name": "Product page",
      "description": "Stock, variants, tabs, and more.",
      "fields": [
        {
          "path": "show_sku",
          "name": "Show product number (SKU)",
          "type": "bool"
        },
        {
          "path": "show_stock_count",
          "name": "Show stock count",
          "description": "Show the exact quantity in stock.",
          "type": "bool"
        },
        {
          "path": "enable_omnibus_price",
          "name": "Show previous price under the Omnibus Directive",
          "description": "Shows the lowest price from the last 30 days as the previous price.",
          "type": "bool"
        }
      ]
    },
    {
      "path": "newsletter",
      "name": "Newsletter",
      "description": "Sign-up form in the footer.",
      "fields": [
        {
          "path": "enable",
          "name": "Show newsletter",
          "type": "bool"
        },
        {
          "path": "title",
          "name": "Heading",
          "description": "Default: Sign up for our newsletter",
          "type": "string"
        },
        {
          "path": "lead",
          "name": "Body text",
          "type": "text"
        }
      ]
    },
    {
      "path": "custom_code",
      "name": "Custom JavaScript",
      "description": "Add your own JavaScript code.",
      "fields": [
        {
          "path": "js",
          "name": "Custom JavaScript",
          "description": "Inserted at the bottom of the page.",
          "type": "text"
        }
      ]
    }
  ]
}

Available field types

Each field in a section is defined with a type property. Here are the available field types:

  • string — Single-line text field. For short values such as payment methods, URLs, or delivery times.
  • bool — Checkbox (on/off). Shown as a checkbox with a label. The value is saved as 0 or 1.
  • color — Color picker with hex input. Supports default_value with a reset button.
  • text — Large text field (textarea). For longer texts, disclaimers, or JavaScript code.
  • wysiwyg — Rich text editor. For formatted HTML content with WYSIWYG editing.
  • image — Image upload. Shows the uploaded image with the option to delete it.
  • list — Dropdown menu. Requires a values array of objects with value and name properties.

How to use theme settings in Smarty templates

You retrieve the settings in your Smarty templates with the $webshop->getThemeSetting() method. The first parameter is the section's path, and the second parameter is the field's path:

<!-- Get a color value -->
<{$primary = $webshop->getThemeSetting('theme', 'primary')}>

<!-- Use the value in inline CSS -->
<div style="color: <{$primary}>">Heading</div>

<!-- Check a boolean -->
<{if $webshop->getThemeSetting('product', 'show_sku')}>
  <span>SKU: <{$product->getSku()}></span>
<{/if}>

<!-- Get an image (returns an Image object) -->
<{$og_image = $webshop->getThemeSetting('open_graph', 'image')}>
<{if $og_image && is_object($og_image)}>
  <meta property="og:image" content="<{$og_image->getSrc(1200, 630, 'fit')}>">
<{/if}>

Tips for a good structure

Here are some recommendations for getting the most out of the accordion layout:

  • Group logically — Keep related fields in the same section. For example, put all colors under "Theme & Colors" and all checkout settings under "Checkout".
  • Write good descriptions — Both sections and fields have a description property. Use it to explain what the setting does, and give examples.
  • Use default_value on colors — Color fields support default_value, which gives the store owner a reset button so they can always return to the default color.
  • Keep path names short and in English — Use snake_case and English names for path fields (e.g. shipping_alert, product_card). User-friendly names belong in the name field.
  • Use the list type for limited choices — Instead of asking the store owner to type in an icon name, give them a dropdown with predefined options.

Summary

The accordion layout is the recommended way to organize theme settings in new Shoporama themes, especially when the theme has more than a handful of sections. It gives the store owner a better overview and faster navigation through search, and it remembers the user's preferences between sessions. All it takes is a single line in your theme_settings.json file.

Share this post