Applying color scheme across all default sections and layouts - Publisher Theme

I’ve installed the latest version of the Publisher theme and created a custom color scheme. I’m able to apply this color scheme to the entirety of the home page and to any additional sections I add on any default layouts (i.e. product pages). However I’m unable to apply this color scheme to the default sections on layouts.

For example on the default-page-layout, there is a section called Product information but the only options on the right hand side of the Theme Editor is to change the Sale badge color scheme and the Sold out badge color scheme, not the entire section. Clicking the link To edit all your theme’s colors, go to your theme settings. just sends you back to the option to edit the color schemes.

I reached out to Support and was advised that the only option to change this is through coding, Theme Support design time, or Shopify Experts. Can I get confirmation if anyone has been able to change the color scheme for their store without needing to resort to coding? It’s very strange to me that you’d be forced to have the default purple gradient background color scheme unless you can code!

Hi @bougiedaley
Can you kindly share your store link (with the password, if any) with us? We will check it and suggest you a solution if possible.

https://ggnzstore.org.nz/

No password.

Specifically https://ggnzstore.org.nz/products/matariki-badge or https://ggnzstore.org.nz/pages/contact-us as examples of default pages where the theme can’t be changed.

Hey there,

I just installed this theme for a friend of mine today and found I had the same problem. I was able to ‘fix’ the product pages in the code, though I’m not sure if there’s a simpler way. Let me describe the problem and then show you my solution.

The problem is two-fold:

  1. Product pages, and their 'Product information" section (and likely all the other layouts we have the issue with) have no concept of color_scheme on the Customize theme page.

  2. Even when we give those layout sections a concept of a color scheme picker, the layout doesn’t use it by default.

The solution:

  1. Make the color scheme picker available in the theme section. I’ll use the ‘Product information’ section in this example:

i) In your shopify admin go to Online Store > Themes > … > Edit code

ii) Use the file search to find and open main-product.liquid
iii) Find the theme “settings”: [ around line 2016 and copy and paste the following two add two settings:

{
  "type": "color_scheme",
  "id": "color_scheme",
  "label": "t:sections.all.colors.label",
  "default": "background-1"
},
{
  "type": "color_scheme",
  "id": "menu_color_scheme",
  "label": "t:sections.header.settings.menu_color_scheme.label",
  "default": "background-1"
},

It should looks like this after you paste it in. Note: the use of commas, quotes, and curly brackets must be copied exactly.

![json-settings-main-product-liquid.png|1422x1254](upload://mUrCflE1jhrydJLLQ20uiyTDbMh.png)

iv) Save. Make sure it saves with no syntax errors.

Now the Product sections have a concept of color scheme. Let’s finish up in the main-product.liquid before leaving this page.

  1. To make your product section use and display the new theme setting:

i) Still in the same main-product.liquid file, go to the top of the file to find the opening <section tag.

ii) We will add the following two classes before the closing " of the class=" parameter:

color-{{ section.settings.color_scheme }} gradient

It should look like this:

![section-class-main-product.png|1962x814](upload://kFBGdjNnr6ZhJbRDyMtEYLPex7g.png)

iii) Save the file again.

That’s it for the code, but you still need to select the color scheme in your Customize theme page like you’re used to.

i) In your Shopify admin go to Online Store > Themes > Customize.

ii) Navigate to the appropriate layout from drop-down menu, e.g. change Home page to Products > Default product

![choose-layout.png|910x596](upload://5Qd05PJ1hJs1334OvD7rP7zI6sr.png)

iii) Find Color scheme and select the scheme you want to match the rest of your site.

![customize-theme-page-selection.png|924x1376](upload://2b3EUzmWmAhUWRNALOFmSJ2b2Fs.png)

iii) Save.

I’m half expecting someone to come out of the woods and say, hey you just needed to change this one global setting for all the other page layouts… because it feels like it should be easier. But I looked and couldn’t find such a setting, and support told you the solution requires code, so… here we are.

The next steps would be to repeat the steps above to edit any other layouts that don’t have this built in. I’m not sure what the section files are yet (that is, the equivalent files to main-product.liquid). I’ll try to post an update with a list of files to edit this way after I do them all on my end.

Hope that helps. LMK if you have any questions.

Next file to update is “main-collection-product-grid.liquid” which handles collection layouts.

Find line 30 that starts with "<div class=“section…” and paste over it with this:


Around line 201 find “settings”: again and insert the same settings:

{
      "type": "color_scheme",
      "id": "color_scheme",
      "label": "t:sections.all.colors.label",
      "default": "background-1"
    },
      {
      "type": "color_scheme",
      "id": "menu_color_scheme",
      "label": "t:sections.header.settings.menu_color_scheme.label",
      "default": "background-1"
    },

Then select your color scheme on the Online Store > Themes > Customize page for the “collection” page.

A faster way to get what we want, without patching the theme files I’m finding, is to just use the section-level Custom CSS on the Customize theme page. Adding background-color: white; (or whatever you want for the background) is a pretty quick fix.

The /collections/ page or “Collections listing” page was a bit weird. I set the section background color, but there was still a gradient background above the Collections title. This was due to a margin exposing some of the main-section background I think. So I targeted the section title and removed the margin, e.g.:

Template > Collections list page > Custom CSS:

{
  background-color: white;
}
.title.title--primary {
  margin-top: 0;
}

I have the same problem, and the solution below do not work.