About using the themeconfig file

Magellan user guide

There are a few of things to know about when using the themeconfig.json file.

Section headers

Sections are important. You need to ensure you have the section headers in your themeconfig file.

If you collapse all branches within the siteconfig.json file you will see there are several sections: comment, title, version...., share, footer, scroll, config, filter.

SiteConfig file sections

When you are copying any elements from a section into your themeconfig file, you must ensure you have the appropriate section header.

For example:

If changing the "scroll" element, this is a section header, so copy the "scroll" section header and the property you want to change into the themeconfig file.

Themeconfig file with scroll element

Note that the comment section is always included in the themeconfig file, but is collapsed in this illustration.

If changing the "toc" element, this is part of the "config" section, so you need to ensure you have the "config" section header, and then copy the "toc" element into the section. The header is only needed once, so you can then copy more "config" elements into the section as needed, such as "header".

Themeconfig file with scroll_toc_header elements

Brackets

Brackets must appear in pairs.

If you are using Notepad++ as your editor, to check all brackets are in pairs click a single bracket to see the opening and closing brackets of the pair highlighted in red. Other editors may do something similar.

In addition, each element needs a following comma (,) after the closing bracket, except the last one.

Themeconfig file with scroll_toc_header with annotation

1

The "scroll" and "toc" elements are not the last ones in the file so both must be closed with a } and a comma (,).

2

The "header" element is the last in the file so no comma is required.

Effect of incorrect code

The themeconfig.json file uses the same formatting as the siteconfig.json file. If there is any incorrect code in the themeconfig.json, such as missing/extra commas or missing/extra brackets, the published output will default back to the siteconfig.json file settings. So if something isn't updating in your site, always check the file.

Browser refresh while testing

If testing themeconfg file changes on a published copy before changing the template file, be aware that browser refresh is very important to see the results of your changes. However, some browsers are harder to refresh than others.

  • Using <Ctrl>+<Shift>+R usually works.
  • But if you are not seeing the expected results you may have to close and reopen the browser completely. This means closing all tabs and all open windows of that browser.

Pro Tip: Consider installing a browser extension to clear the cache.