Code editor: edit theme files directly in admin
The code editor lets you edit your theme's HTML, CSS, and JavaScript files directly in admin. See which theme your customers see, make a copy of a default theme, and undo changes with previous versions.
The code editor is Shoporama's built-in editor for theme files. It lets you open, edit, create, and delete the files in your theme directly in the browser, without installing any software and without logging in with SFTP. It is the fastest way to make a small change to a template, a bit of CSS, or an automatic email.
Note: this is a technical page. When you edit the active theme, you are working directly in the files your online store is built from, and the change takes effect as soon as you save. The editor keeps previous versions of the files, so you can roll a file back, but a single wrong character can still cause an error page for all your customers right away. If you haven't worked with HTML, CSS, or Smarty before, use the regular design tools further down in this article instead, or have your theme developer make the change.
Where to find the code editor
Click Design in the left menu, and choose Code editor. The page consists of a file list on the left and the editor itself on the right. Below the file list is the Shoporama's Themes box, where you can make a copy of Shoporama's themes.
What you can edit
The code editor shows the themes in your own store's theme folder, meaning the themes you or your developer uploaded via SFTP, and the copies you or Claude made. Each theme is its own block, with the theme's name in a gray heading and a badge that tells you whether the store uses the theme. Only files with these five extensions are included in the list:
- .html files are the theme's templates, the pages your customers see
- .css controls colors, fonts, and layout
- .js files are JavaScript
- .txt and .ini are text and configuration files
Images and fonts are not shown. You upload those under Design → Files. The templates are usually in a templates folder, so templates/product.html is the product page, templates/basket.html is the cart, and templates/mails/invoice.html is the order confirmation. The names can vary a little from theme to theme. If you only need to change the text in the emails, read the guide to email templates in your theme first.
Important: Shoporama's built-in default themes and themes bought in the Theme shop are not in the file list, because they are stored outside your store's own theme folder. If you want to edit the code in a default theme, you first make a copy of it. See the section Make a copy of a theme further down.
How the page is laid out

- The file list on the left, with the "Filter files..." field at the top. If you type "product", for example, only files with "product" in the name or path are shown, and the folders with a match are expanded. If no files match, it says "No files match".
- The themes are listed separately, each with its name in a gray heading and a badge: Active, In use, or Inactive. Themes that aren't active show when they were last modified, and copies made in admin or by Claude show which theme they were made from. The arrow next to the name collapses the whole theme, so only the name and the badge remain.
- Folders and files are shown as a tree. Click a folder to expand or collapse it. The editor remembers in your browser which folders and themes you have expanded, also the next time you visit.
- "Create new file" at the bottom of each theme.
- A padlock next to a file name means that the file is not writable and therefore cannot be opened. The explanation is shown at the bottom: "The file is not writable - set the permissions via SFTP."
- The editor field with line numbers and syntax highlighting. The file's full name is shown above the field. CSS and JavaScript files get their own syntax highlighting, while all other files are shown with HTML highlighting.
- The buttons Save, Delete, Full screen, and Previous versions, plus a status that briefly shows "Saved!" or "Error saving file".
- Shoporama's Themes below the file list, with a Copy button next to each theme.
Is this the theme your customers see?
The file list shows all the themes in your theme folder, including the ones the store doesn't use. If you edit a theme that isn't active, nothing happens in the store. That's why the editor always shows which theme your customers see:
- Active next to the theme's name means that it is the theme the store shows.
- In use means that the theme is used by one of the store's countries under Webshop → Countries, or that it is a variant in a theme split test that is running or about to start. So some of your customers see the theme.
- Inactive means that no customers see the theme. If you open a file in it, this is shown above the code: "The theme is not active, so changes will not be visible in the store."
- If the store uses one of Shoporama's default themes or a theme from the Theme shop, a yellow box appears at the top of the page, such as "The store uses Montana, which cannot be edited here." It also tells you that the themes in the list are not active, and, for a default theme, that you lose the fixes we have made to it since if you switch to an older copy.

A theme with the Inactive badge has two buttons. A theme marked In use only has Enable:
- Preview opens your store with the theme in a new tab. Only you see it, and your customers still see the active theme. The Preview the theme link above the code does the same.
- Enable makes the theme the one your customers see. You are asked first: "Enable the Montana-v2 theme? Your customers will see it once the change is complete, typically after a minute." Meanwhile, the store shows a short waiting message. Afterward, you are back in the same file with the message "The theme Montana-v2 is now active."
If online pages from the page designer use modules that the new theme doesn't have, you get a warning with links to the pages. Your customers see an error box instead of the module until you take the pages offline or switch back. To undo a switch, choose the previous theme under Design → Theme and click Save. If the previous theme was one of your own, you can also click Enable next to it in the file list.
Preview and Enable require your store to run Smarty 4 and be on the Pro pricing plan. Otherwise, you choose the theme under Design → Theme and click Save.
Make a copy of a theme
Shoporama's default themes can't be edited directly, but you can make your own copy of them. The copy becomes a separate theme in the file list, where you can edit all its files, and your customers only see it once you activate it.

- Click Copy next to the theme in the Shoporama's Themes box below the file list. You can also use the copy icon next to See demo for the theme under Design → Theme.
- Change the Name of the copy if you like. The editor suggests an available name, such as "Montana-kopi". The name can contain a-z, numbers, hyphens, and underscores, but no spaces or the Danish letters æ, ø, and å.
- Click Make a copy. You return to the editor with the message "The copy Montana-kopi has been created.", and the copy appears in the file list with the Inactive badge. If you copied from Design → Theme, you return there, where the Open in Code editor link takes you here.
- Expand the copy in the file list, edit it, view it with Preview, and click Enable when it is ready.
If you want to copy one of your own themes, such as the active one, before making bigger changes, you do it under Design → Theme with the copy button next to the theme under Custom themes. The copy gets the name you choose and then appears in the file list with the Inactive badge.

Three things are good to know before you copy:
- The copy doesn't receive Shoporama's updates. Fixes and new features we add to the default theme are not included in your copy. If you can make do with Theme settings, Stylesheet, or the page designer, you keep the updates.
- New CSS classes don't work on their own. The default themes' CSS is prebuilt, so new classes from Tailwind, for example, that the theme doesn't already use have no effect in the copy. Use the classes the theme already uses, or add your own CSS under Design → Stylesheet.
- The copy shares settings with the store. Theme settings, logo, and stylesheet are saved for the store, not for the individual theme. If you change a theme setting while working in the copy, it also changes in the theme your customers see.
Copies require your store to run Smarty 4 and be on the Pro pricing plan, and you can have at most 10 custom themes. Themes from the Theme shop and the older themes Alaska and Massachusetts can't be copied. To delete a copy you don't need, use the trash can next to the theme under Design → Theme. You can also ask Claude to make the copy and the change for you, see Edit your theme with Claude, or upload your own copy via SFTP.
How to save a change
- Click the file name in the list. The content is loaded, and the file's name is shown above the editor field.
- Make your changes.
- Click Save, or press Cmd+S on Mac or Ctrl+S on Windows.
- The confirmation "Saved!" flashes briefly. If you see "Error saving file" instead, the change was not saved, and you should check whether the file is writable. If there is an error in the Smarty code in a template, the error is shown with a line number instead, such as "Smarty syntax error on line 2: unknown tag 'ficlose'". In that case, the file is not saved either. This check applies to stores on Smarty 4, and the message is always in English.
There is no draft and no publish button. When you click Save, the file is written immediately, the old version is saved as a version, and if the theme is active, the store uses the new version from the next page view. If you switch files without saving, the editor asks "You have unsaved changes. Do you want to continue?". But if you close the tab or reload the page, your changes are lost without warning.
Create and delete files
At the bottom of each theme group is "Create new file". You are asked to enter a file name, and you can include a path, such as templates/my-page.html, if the file should be in a subfolder that already exists. The file is created empty, and the list reloads. The Delete button deletes the file you have open. You are asked "Are you sure?" first, and then the file is gone from the list. There is no trash, but the file's last version is saved as a version, so it can be restored. See the next section.
Previous versions and undo
Every time a file is saved or deleted, Shoporama saves the old version as a version. This applies to changes made here in the editor, changes from Claude, and changes via the API. The latest 20 versions of each file are kept. Changes you make via SFTP are not included.
- Open the file in the file list.
- Click Previous versions next to Full screen. You see the saved versions with the time under Saved and the file's Size, newest first.
- Click Restore next to the version you want to go back to, and confirm "Restore this version? The current version will first be saved as a version."

Because the current version is saved first, you can also undo a restore. Open Previous versions again, and restore the top version. If it says "There are no previous versions of the file yet.", the file hasn't been changed since versions were introduced, or only via SFTP. If it says "No versions of this theme are saved.", versions can't be saved for that particular theme, and the advice below applies.
A deleted file disappears from the list, but its last version is still stored as a version. Ask Claude to restore it, or create a new file with exactly the same name and path with "Create new file", open it, and restore the version under Previous versions.
Undo with Cmd+Z or Ctrl+Z only works inside the editor, as long as the page hasn't been reloaded. Versions apply to one file at a time and only the latest 20 times it was saved, so still make sure you have your own backup before making bigger changes:
- If you are working in a theme where versions aren't saved, select the entire content of the file, copy it, and save it in a text file on your own computer.
- Make a copy of the theme if you need to make bigger changes, and work in the copy. View it with Preview before you activate it.
- Make small changes at a time, and check the store after each one. That way you know exactly what went wrong, if something does.
Theme files are Smarty, not plain HTML
The files look like HTML, but they also contain template code that pulls data from your store. Shoporama uses the Smarty template language, and in Shoporama, Smarty code is written with an angle bracket around the curly braces:
<{$product->getName()}>
<{if $product->getPrice()}>
<p><{$product->getPrice()}> DKK</p>
<{/if}>
<{foreach $products as $product}>
<{$product->getName()}>
<{/foreach}>
Notice that it is <{$foo}> and not just curly braces, as in many other systems. If you copy code from the web, that is often exactly why it doesn't work. Every <{if}> needs an <{/if}>, and every <{foreach}> a <{/foreach}>. If you forget one on a store with Smarty 4, the editor rejects the file and shows the error with a line number. If a closing tag is missing, the line number points to the end of the file, so look upward for the block that isn't closed. On Smarty 2, the file is saved anyway, and you typically get an error page across the entire store, so always count before you save.
For an overview of the variables and methods you can use in the templates, see Variables in a Shoporama theme.
The most important warnings
- In the active theme, you are working on the live store. If you save a mistake at 8 p.m. on a Friday, your customers see it at 8 p.m. on Friday.
- Undo works one file at a time. Previous versions restores one file, not the whole theme, and changes via SFTP are not saved as versions. Make a copy of the theme before bigger changes, and only activate it once you have viewed it with Preview.
- Your changes can be overwritten by a theme update. If you get a new version of the theme from your developer, or you upload the theme again yourself via SFTP, the files are replaced, and your changes are gone. Always write down what you changed.
- Check that you are editing the active theme. The file list shows all themes in the theme folder, not just the one in use. If the theme says Inactive, your customers won't see your changes until you activate it.
- Never delete a file if you don't know what it is for. If a template the store expects is missing, the whole page can go down.
- The editor doesn't save automatically. If you close the tab with unsaved changes, they are lost.
Is there an easier and less risky way?
Much of what people go to the code editor for can be done elsewhere in admin without any risk. It saves both time and possible downtime, so look here first:
- Design → Theme settings for colors, logos, and the options the theme itself provides.
- Design → Stylesheet for your own CSS changes.
- Design → Texts for fixed texts and translations, and Design → Page designer for building pages from ready-made blocks without code.
- Webshop → HTML fields for tracking scripts and similar code that needs to go in the head or body. See the guide to HTML fields.
- Claude for changes to the theme itself. Claude makes the change in a copy of the theme and gives you a link, so you can see the result before your customers do. See Edit your theme with Claude.
For technical users
The editor is built on CodeMirror. The following keyboard shortcuts work:
- Cmd+S or Ctrl+S saves, even when the cursor is outside the editor field.
- Cmd+Z or Ctrl+Z undoes, Shift+Cmd+Z or Ctrl+Y redoes.
- Cmd+F or Ctrl+F searches, Cmd+G or Ctrl+G finds the next match, and Alt+G jumps to a line number.
- Ctrl+Space autocompletes HTML tags and attributes.
- F11 toggles full screen, and Esc closes it. In full screen, there is a toolbar with Save and Close.
A few more things: new files can only be created in folders that already exist, so new folders are created via SFTP. If you save a file as completely empty, the editor may show "Error saving file", even though the file was actually emptied. If your store is live, finished HTML pages are cached for up to four hours for regular visitors, while the cart, address, shipping, and payment pages are never cached that way. If your theme still runs Smarty 2, some functions are written differently, see the guide to Smarty 4. The versions of a file can also be retrieved and restored via the REST API.
Frequently asked questions
My store shows an error after I saved. What do I do?
Open the file, click Previous versions, and restore the top version. That is the version from just before you saved. If you made the change via SFTP, there is no version, and you need to put your own copy of the file back. On stores with Smarty 4, syntax errors such as an <{if}> without an <{/if}> are rejected before the file is saved, but errors that only occur when the page is displayed get through. If you can't find the error, email support@shoporama.dk with the name of the file and what you changed.
Can I undo a change the next day?
Yes, if the change was saved in the editor, by Claude, or via the API. Open the file, click Previous versions, and restore the version you want to go back to. The latest 20 versions of each file are kept, and the oldest are removed as new ones are added. Changes via SFTP are not saved as versions, so for those, a copy of the theme is still your only backup.
Can I get back a file I deleted?
Yes, if it was deleted here in the editor, by Claude, or via the API, because then its last version is saved as a version. Ask Claude to restore it, or create a new file with exactly the same name and path, open it, and restore the version under Previous versions.
Why can't I see my theme in the list?
The code editor only shows themes in your own store's theme folder. If you use one of Shoporama's default themes, the top of the page says that the store uses it. Click Copy next to the theme in the Shoporama's Themes box below the file list and then Make a copy, and the copy appears in the list. This requires Smarty 4 and the Pro pricing plan. The older themes Alaska and Massachusetts and themes from the Theme shop can't be copied.
How do I know which theme is active?
Look at the badge next to the theme's name in the file list. The active theme has the Active badge, and the others Inactive or In use. If the store uses one of Shoporama's themes or a theme from the Theme shop, it says so in the yellow box at the top. You choose the theme under Design → Theme.
Why can't I see my change in the store?
First try a hard reload with Cmd+Shift+R or Ctrl+Shift+R, so the browser downloads the CSS and JavaScript again. If the store is live, finished pages can also be cached for up to four hours for regular visitors. And if the theme says Inactive, your customers won't see the change. Use Preview to see it yourself, or Enable when the theme is ready.
Why can't I see the Activate button?
The active theme has no Activate button, and if the theme is collapsed, you first need to expand it with the arrow next to the name. For the other themes, the button requires your store to run Smarty 4 and be on the Pro pricing plan. Otherwise, you choose the theme under Design → Theme and click Save. This also applies if you want to switch to one of Shoporama's themes.
Will my copy get the improvements you make to Montana?
No. A copy is your own theme, and it only changes when you or Claude edit it. The code editor and Design → Theme show below the copy's name when it was made, such as "Copy of Montana from 24.11.2026". If a theme doesn't say "Copy of", it was uploaded via SFTP or made before Shoporama started saving this information. If you want the latest fixes, make a new copy and move your own changes over to it.
How do I delete a copy I don't need?
Under Design → Theme with the trash can next to the theme. The active theme can't be deleted, and deleting requires Smarty 4 and the Pro pricing plan. Support can recover a deleted theme for up to 30 days. The Delete button in the code editor only deletes the file you have open.
Why are my folders collapsed again?
The editor remembers which folders are expanded in your browser. If you use a different browser or computer, or you have cleared your browser data, the folders start out collapsed again. If you open a file via a link, the folders leading to it expand automatically.
Why is there a padlock next to some files?
The padlock means that the file is not writable, so it can't be opened and saved from the editor. The file permissions on the server are blocking it, and they are changed via SFTP. If you don't have SFTP access yourself, ask your developer to do it.
Should I use the code editor to add a tracking script?
No, use the HTML fields under Webshop → HTML fields. That way, the script is stored in the store's settings and survives a theme update. If you put it directly into a theme file, it disappears the day the theme is uploaded again.
Can I roll out the same change to all my stores at once?
No. The code editor only works in the store you have selected in admin, so the change has to be repeated in each store. If you have many stores with the same theme, it is better to get the change into the theme itself and upload it to all the stores via SFTP.
Related articles
Email templates in your theme: complete overview
Overview of all email templates in Shoporama themes. Learn what each template does, when it is sent, and which variables you can use to customize...
Log in with SFTP to edit your theme
How to log in to your Shoporama store with SFTP so you can edit your theme files in your own SFTP client.
Smarty template variables in Shoporama themes
Overview of the global and page-specific Smarty variables available in Shoporama themes, such as the cart, customer, campaigns, products, and...
HTML fields: add Cookiebot, GTM, and other scripts to your store
How to use HTML fields in Shoporama to add Cookiebot, Google Tag Manager, Facebook Pixel, chat widgets, and other custom HTML or JavaScript to your...
How to upgrade your theme to Smarty 4
Upgrade your Shoporama store from Smarty 2 to Smarty 4. Smarty 4 is faster, more secure, and runs on PHP 8.
Link to stylesheets and other files in your theme
How to link to stylesheets, JavaScript, images, and other files from your Shoporama theme using the $theme_url variable.
Shoporama themes: an overview of all free store themes
A complete overview of all free themes in Shoporama: Delaware, DelawareDK, California, Alaska 2, Washington, Montana, and the classic Smarty 2...
Edit your theme with Claude: test changes in a copy before going live
Ask Claude to make a copy of your theme and build the change, for example a stock badge on your products. You see the result in a preview your...
Related features
Accordion layout for theme settings in Shoporama
Learn how to use the accordion layout in theme_settings.json to organize Shoporama theme settings with search, collapsible sections, and localStorage.
Full design freedom: your design, your rules
Design your online store freely with full access to HTML, CSS, and templates. Use ready-made themes, the drag-and-drop Page designer, or build from...
Now Claude can change your theme, and you see it before your customers do
Ask Claude for a stock badge, a discount badge, or a countdown. Claude builds it in a copy of your theme, you see it first, and you make it live.
Choose a theme and understand theme settings and the page designer
Choose and switch themes in Shoporama, and learn how Webshop settings, theme settings, texts, and the page designer differ before you build your...