Overview
Making major changes to an active theme on a busy site is...scary. Remove the anxiety by cloning your active theme and working in the clone, instead. When you're ready to take the changes live, activate the clone. Continue reading below for in-depth instructions.
Cloning a Theme
When you clone a theme, AmeriCommerce creates a precise replica of the theme and all its files (think of it like copying and pasting some text, but for themes)**. To clone a theme,
- Click Themes in the admin dashboard navigation menu to go get to themes dashboard
- Once on the themes dashboard, click the cog icon under the theme you would like to clone
- In the sub menu that drops-down, click clone:
It will take the system a few moments to copy all those files, so hang on! The cloning process takes place in the background, so once its complete, you may need to refresh your page to see the clone. It will be under Recently Installed Themes.
**Note: the cloning process creates an exact copy of a theme's HTML; however, widgets have ID numbers that must unique. This means a clone will have different ID numbers than the original theme it was cloned from. If your theme has widget's with enable merge code turned on and the widget's merge code is in a page's HTML (looks something like this: $$HTML2326$$), be sure edit that page's HTML and change the ID in the merge code to the new ID, or the widget will not show.
Renaming the Clone and Directory (Folder)
The clone'd theme's name will be the name of the original plus a unique cone identifier. You can change the name to something more friendly in global theme settings:
If you change the name of the theme, its a good idea to change the theme's directory name to match. This can also be done in global theme settings:
Matching theme and directory names is optional; however, it simplifies editing the theme and identifying the theme's files in the file system.
Previewing Changes
You can preview any theme, including clones. You can do this from the theme's dashboard by clicking the cog icon, then preview:
The preview will have a query string that identifies the theme being previewed:
Visiting almost any page with this query string will put a cookie in your browser that tells the server to show you this theme on any page you navigate to, until you clear the cookie or replace it by previewing another theme. Your customer's will still be seeing the active theme, because they don't have the cookie in their browser. To go back to seeing what your customer's see, open an incognito window, or preview your active theme. When you do so, notice that the ID in the query string has changed:
Now that we know both theme Ids, we can switch between theme by changing the sessionthemeid in the address bar and hitting enter. The page reloads, and the server sends you a preview of whatever theme you specified in the query string:
This is really handy when you need to switch back and forth between two themes while making changes.
Activating the new Theme
When you're ready to active the clone, simply click the cog icon under it, then activate:
Troubleshooting
Menus and other widgets not showing? Check the widget Ids in the page's HTML. The cloning process creates an exact copy of a theme's HTML; however, widgets have ID numbers that must be unique. This means a clone will have different ID numbers than the original theme it was cloned from. This is usually not an issue; however, If your theme has widget's with enable merge code turned on, and the widget's merge code is in a page's HTML (looks something like this: $$HTML2326$$), be sure edit that page's HTML and change the ID of the widget merge code to the new ID, or the widget will not show.