<!-- wp:heading -->
<h2>Settings</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>For each Shopify store's theme, there must have a theme settings file to save all the customized theme settings data.  the file name is settings_schema.json which is a kind of <a href="https://www.json.org/json-en.html">JSON</a> format file.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Location</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>the settings_schema.json is located at : <strong>shopify admin -&gt; online store -&gt; themes -&gt; current online them -&gt; Actions Dropdown -&gt; edit code -&gt; config -&gt; settings_schema.json</strong></p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":487,"sizeSlug":"full","linkDestination":"none"} -->
<div class="wp-block-image"><figure class="aligncenter size-full"><img src="https://www.mojoin.com/wp-content/uploads/2021/10/settings-schema-location.png" alt="" class="wp-image-487"/></figure></div>
<!-- /wp:image -->

<!-- wp:heading -->
<h2>Add new Image Setting</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>As we know we can set Shopify stores' logo at theme header part. But there is a limitation in this way desktop and mobile versions have the same logo. if you want to show a different logo for a mobile browser, how can we achieve this?</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Definitely, we need to find somewhere to set this logo image for the mobile browser, so the best location is we put the settings in Shopify's theme setting which means we can add our logo image settings into the settings_schema.json file directly.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>open your settings_schema.json file, copy the following codes and paste them into :</p>
<!-- /wp:paragraph -->

<!-- wp:enlighter/codeblock -->
<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">{
 "name": "mobile logo",
 "settings": [
  {
   "type": "image_picker",
   "id": "yx_mobilelogo"
  }
 ]
},</pre>
<!-- /wp:enlighter/codeblock -->

<!-- wp:paragraph -->
<p>when you finished your config file will look like this:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":490,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full"><img src="https://www.mojoin.com/wp-content/uploads/2021/10/config-updated-with-newimage.png" alt="" class="wp-image-490"/><figcaption><br><br><br> here we add a new setting with name "<strong>mobile logo</strong>" and its type is "<strong>image_picke</strong>r" , settings name is "<strong>yx_mobilelogo</strong>".  image_picker is kind of Image Picker setting controller from Shopify.<br>Shopify has developed for use , we just setup and use it directly.<br><br>For Shopify settings there are two types of setting we can use.<br><a href="https://shopify.dev/themes/architecture/settings/input-settings">Input Settings</a> - Settings that can hold a value, and are configurable by merchants.<br><a href="https://shopify.dev/themes/architecture/settings/sidebar-settings">Sidebar Settings</a> - Settings that can’t hold a value, and aren’t configurable by merchants. They’re informational elements that can be used to provide detail and clarity for your input settings. <br><br>Save it. go to your theme settings page, you will see your mobile logo setting item there:</figcaption></figure>
<!-- /wp:image -->

<!-- wp:image {"id":496,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full"><img src="https://www.mojoin.com/wp-content/uploads/2021/10/mobile-logo-changes.png" alt="" class="wp-image-496"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Access Logo Image Setting</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>We have put the mobile logo image setting in the theme settings, can be changed easily from the Shopify backend. Now we need to use this setting somewhere. Just as setting's name guide we should show mobile logo on the mobile browser only. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Normally Shopify logo file setting will be used at Shopify Header liquid file, for example Shopify Debut theme header.liquid which is at :<br><strong>Shopify Admin -&gt; Online Store -&gt; Themes -&gt; Current Theme Dropdown -&gt; Edit Code -&gt; Sections -&gt; header.liquid</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In the file your can search by "section.settings.logo", will show you where Shopify uses this one to show your store logo image from your theme header section settings. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In our case we can access our mobile logo image with : "<strong>settings.yx_mobilelogo</strong>", snippet codes as below:</p>
<!-- /wp:paragraph -->

<!-- wp:enlighter/codeblock -->
<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""> &lt;div class="grid grid--no-gutters grid--table site-header__mobile-nav">
      &lt;div class="grid__item {{ logo_classes }} yx-mobile-logo-only">
          &lt;div class="h2 site-header__logo">
            {%- assign img_url = settings.yx_mobilelogo | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
            &lt;a href="{{ routes.root_url }}" class="yx-mobile-head-logo site-header__logo-image{% if section.settings.align_logo == 'center' %} site-header__logo-image--centered{% endif %}">
             &lt;div class="yx-mobile-head-logo-div">
              {% capture logo_alt %}{{ settings.yx_mobilelogo_alt | default: shop.name }}{% endcapture %}
             &lt;img class="lazyload js"
                   src="{{ settings.yx_mobilelogo | img_url: '300x300' }}"
                   data-src="{{ img_url }}"
                   data-widths="[180, 360, 540, 720, 900, 1080, 1296, 1512, 1728, 2048]"
                   data-aspectratio="{{ settings.yx_mobilelogo.aspect_ratio }}"
                   data-sizes="auto"
                   alt="{{ logo_alt | escape }}"
                   style="max-width: 900px">
              &lt;noscript>
                {% capture image_size %}{{ section.settings.logo_max_width | escape }}x{% endcapture %}
                &lt;img src="{{ settings.yx_mobilelogo | img_url: image_size }}"
                     srcset="{{ settings.yx_mobilelogo | img_url: image_size }} 1x, {{ settings.yx_mobilelogo | img_url: image_size, scale: 2 }} 2x"
                     alt="{{ settings.yx_mobilelogo_alt | default: shop.name }}"
                     style="max-width: 900px;">
              &lt;/noscript>
              &lt;/div>
            &lt;/a>
         &lt;/div>
      &lt;/div>
    &lt;/div></pre>
<!-- /wp:enlighter/codeblock -->

<!-- wp:paragraph -->
<p>you can copy and tailer them as your requirement. as you see we use CSS class "yx-mobile-logo-only" to control this logo only be shown in mobile browser. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>CSS style as :</p>
<!-- /wp:paragraph -->

<!-- wp:enlighter/codeblock -->
<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">.yx-mobile-logo-only{
    display:none;
  }
@media only screen and (max-width: 749px){
  .yx-mobile-logo-only{
    display: inline-flex;
  }
}</pre>
<!-- /wp:enlighter/codeblock -->