How can I copy scheme settings from one section to another?

How can I copy scheme settings from one section to another?

Nasar1999
Tourist
18 0 1
  1. Hello i have created new section.liquid However, this section is missing the scheme settings. I would like to know how I can copy the scheme settings from another section in the theme.
Replies 4 (4)

BaileyPaserk
Shopify Partner
116 9 27

Do you mean that you copied the settings schema from the bottom of the code in {% schema %} tags, but they are showing default/empty fields?

Each section on your theme has the settings stored in settings_schema.json so you'd find your original section and then copy the settings and then find your new section and do the same. You could also set the defaults in the code. Or manually just fill in the inputs. 

 

If you are not even seeing the option to create the settings in the customizer, you need to copy the whole section.liquid code. This will be the html and then at the bottom {% schema %} tags that contains the json settings. 

Bailey Paserk
Nasar1999
Tourist
18 0 1

I did this but unfortunately when I change the background color nothing happened:
{% schema %}
{
"name": "Slick Slider",
"settings": [
{
"type": "text",
"id": "heading",
"label": "Heading",
"default": "My Custom Heading"
},
{
"type": "select",
"id": "Slick_Slider_color_scheme",
"options": [
{
"value": "accent-1",
"label": "t:sections.all.colors.accent_1.label"
},
{
"value": "accent-2",
"label": "t:sections.all.colors.accent_2.label"
},
{
"value": "background-1",
"label": "t:sections.all.colors.background_1.label"
},
{
"value": "background-2",
"label": "t:sections.all.colors.background_2.label"
},
{
"value": "inverse",
"label": "t:sections.all.colors.inverse.label"
}
],
"default": "background-1",
"label": "t:sections.all.colors.label",
"info": "t:sections.all.colors.has_cards_info"
}
],
"presets": [
{
"name": "Slick Slider"
}
]
}
{% endschema %}

BaileyPaserk
Shopify Partner
116 9 27

Hmmm. I don’t think I’d be able to help further unless I’m seeing the whole code. With the html included.

Bailey Paserk
Nasar1999
Tourist
18 0 1

Here is the full code of the section:

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1">

 <link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700' rel='stylesheet' type='text/css'>

<link rel="stylesheet" href="https://drive.google.com/u/2/uc?id=1UJX4wog0wXlStUO2omdzFvuXh-bSj_YQ&export=download"> <!-- Custom style -->

<style>

/* --------------------------------

 

Primary style

 

-------------------------------- */

*, *::after, *::before {

-webkit-box-sizing: border-box;

-moz-box-sizing: border-box;

box-sizing: border-box;

}

 

html * {

-webkit-font-smoothing: antialiased;

-moz-osx-font-smoothing: grayscale;

}

 

html {

font-size: 62.5%;

}

 

body {

font-size: 1.6rem;

font-family: "Source Sans Pro", sans-serif;

color: #aebcb9;

background-color: #0d0d0d;

}

 

a {

text-decoration: none;

}

 

.cd-title {

position: relative;

height: 160px;

line-height: 230px;

text-align: center;

}

.cd-title h1 {

font-size: 2.4rem;

font-weight: 700;

}

@media only screen and (min-width: 768px) {

.cd-title {

line-height: 250px;

}

}

@media only screen and (min-width: 1170px) {

.cd-title {

height: 200px;

line-height: 300px;

}

.cd-title h1 {

font-size: 3rem;

}

}

 

.cd-intro {

width: 100%;

max-width: 1468px;

text-align: center;

}

 

.cd-intro {

margin: 4em auto;

}

@media only screen and (min-width: 768px) {

.cd-intro {

margin: 5em auto;

}

}

@media only screen and (min-width: 1170px) {

.cd-intro {

margin: 6em auto;

}

}

 

.cd-headline {

font-size: 1.76rem;

line-height: 1.2;

}

@media only screen and (min-width: 768px) {

.cd-headline {

font-size: 3.1rem;

font-weight: 300;

}

}

@media only screen and (min-width: 1170px) {

.cd-headline {

font-size: 4.6rem;

}

}

 

.cd-words-wrapper {

display: inline-block;

position: relative;

text-align: center;

}

.cd-words-wrapper b {

display: inline-block;

position: absolute;

white-space: nowrap;

left: 0;

top: 0;

}

.cd-words-wrapper b.is-visible {

position: relative;

}

.no-js .cd-words-wrapper b {

opacity: 0;

}

.no-js .cd-words-wrapper b.is-visible {

opacity: 1;

}

 

/* --------------------------------

 

xrotate-1

 

-------------------------------- */

.cd-headline.rotate-1 .cd-words-wrapper {

-webkit-perspective: 300px;

-moz-perspective: 300px;

perspective: 300px;

}

.cd-headline.rotate-1 b {

opacity: 0;

-webkit-transform-origin: 50% 100%;

-moz-transform-origin: 50% 100%;

-ms-transform-origin: 50% 100%;

-o-transform-origin: 50% 100%;

transform-origin: 50% 100%;

-webkit-transform: rotateX(180deg);

-moz-transform: rotateX(180deg);

-ms-transform: rotateX(180deg);

-o-transform: rotateX(180deg);

transform: rotateX(180deg);

}

.cd-headline.rotate-1 b.is-visible {

opacity: 1;

-webkit-transform: rotateX(0deg);

-moz-transform: rotateX(0deg);

-ms-transform: rotateX(0deg);

-o-transform: rotateX(0deg);

transform: rotateX(0deg);

-webkit-animation: cd-rotate-1-in 1.2s;

-moz-animation: cd-rotate-1-in 1.2s;

animation: cd-rotate-1-in 1.2s;

}

.cd-headline.rotate-1 b.is-hidden {

-webkit-transform: rotateX(180deg);

-moz-transform: rotateX(180deg);

-ms-transform: rotateX(180deg);

-o-transform: rotateX(180deg);

transform: rotateX(180deg);

-webkit-animation: cd-rotate-1-out 1.2s;

-moz-animation: cd-rotate-1-out 1.2s;

animation: cd-rotate-1-out 1.2s;

}

 

@-webkit-keyframes cd-rotate-1-in {

0% {

-webkit-transform: rotateX(180deg);

opacity: 0;

}

35% {

-webkit-transform: rotateX(120deg);

opacity: 0;

}

65% {

opacity: 0;

}

100% {

-webkit-transform: rotateX(360deg);

opacity: 1;

}

}

@-moz-keyframes cd-rotate-1-in {

0% {

-moz-transform: rotateX(180deg);

opacity: 0;

}

35% {

-moz-transform: rotateX(120deg);

opacity: 0;

}

65% {

opacity: 0;

}

100% {

-moz-transform: rotateX(360deg);

opacity: 1;

}

}

@keyframes cd-rotate-1-in {

0% {

-webkit-transform: rotateX(180deg);

-moz-transform: rotateX(180deg);

-ms-transform: rotateX(180deg);

-o-transform: rotateX(180deg);

transform: rotateX(180deg);

opacity: 0;

}

35% {

-webkit-transform: rotateX(120deg);

-moz-transform: rotateX(120deg);

-ms-transform: rotateX(120deg);

-o-transform: rotateX(120deg);

transform: rotateX(120deg);

opacity: 0;

}

65% {

opacity: 0;

}

100% {

-webkit-transform: rotateX(360deg);

-moz-transform: rotateX(360deg);

-ms-transform: rotateX(360deg);

-o-transform: rotateX(360deg);

transform: rotateX(360deg);

opacity: 1;

}

}

@-webkit-keyframes cd-rotate-1-out {

0% {

-webkit-transform: rotateX(0deg);

opacity: 1;

}

35% {

-webkit-transform: rotateX(-40deg);

opacity: 1;

}

65% {

opacity: 0;

}

100% {

-webkit-transform: rotateX(180deg);

opacity: 0;

}

}

@-moz-keyframes cd-rotate-1-out {

0% {

-moz-transform: rotateX(0deg);

opacity: 1;

}

35% {

-moz-transform: rotateX(-40deg);

opacity: 1;

}

65% {

opacity: 0;

}

100% {

-moz-transform: rotateX(180deg);

opacity: 0;

}

}

@keyframes cd-rotate-1-out {

0% {

-webkit-transform: rotateX(0deg);

-moz-transform: rotateX(0deg);

-ms-transform: rotateX(0deg);

-o-transform: rotateX(0deg);

transform: rotateX(0deg);

opacity: 1;

}

35% {

-webkit-transform: rotateX(-40deg);

-moz-transform: rotateX(-40deg);

-ms-transform: rotateX(-40deg);

-o-transform: rotateX(-40deg);

transform: rotateX(-40deg);

opacity: 1;

}

65% {

opacity: 0;

}

100% {

-webkit-transform: rotateX(180deg);

-moz-transform: rotateX(180deg);

-ms-transform: rotateX(180deg);

-o-transform: rotateX(180deg);

transform: rotateX(180deg);

opacity: 0;

}

}

/* --------------------------------

 

xtype

 

-------------------------------- */

.cd-headline.type .cd-words-wrapper {

vertical-align: top;

overflow: hidden;

}

.cd-headline.type .cd-words-wrapper::after {

/* vertical bar */

content: '';

position: absolute;

right: 0;

top: 50%;

bottom: auto;

-webkit-transform: translateY(-50%);

-moz-transform: translateY(-50%);

-ms-transform: translateY(-50%);

-o-transform: translateY(-50%);

transform: translateY(-50%);

height: 90%;

width: 1px;

background-color: #aebcb9;

}

.cd-headline.type .cd-words-wrapper.waiting::after {

-webkit-animation: cd-pulse 1s infinite;

-moz-animation: cd-pulse 1s infinite;

animation: cd-pulse 1s infinite;

}

.cd-headline.type .cd-words-wrapper.selected {

background-color: #aebcb9;

}

.cd-headline.type .cd-words-wrapper.selected::after {

visibility: hidden;

}

.cd-headline.type .cd-words-wrapper.selected b {

color: #0d0d0d;

}

.cd-headline.type b {

visibility: hidden;

}

.cd-headline.type b.is-visible {

visibility: visible;

}

.cd-headline.type i {

position: absolute;

visibility: hidden;

}

.cd-headline.type i.in {

position: relative;

visibility: visible;

}

 

@-webkit-keyframes cd-pulse {

0% {

-webkit-transform: translateY(-50%) scale(1);

opacity: 1;

}

40% {

-webkit-transform: translateY(-50%) scale(0.9);

opacity: 0;

}

100% {

-webkit-transform: translateY(-50%) scale(0);

opacity: 0;

}

}

@-moz-keyframes cd-pulse {

0% {

-moz-transform: translateY(-50%) scale(1);

opacity: 1;

}

40% {

-moz-transform: translateY(-50%) scale(0.9);

opacity: 0;

}

100% {

-moz-transform: translateY(-50%) scale(0);

opacity: 0;

}

}

@keyframes cd-pulse {

0% {

-webkit-transform: translateY(-50%) scale(1);

-moz-transform: translateY(-50%) scale(1);

-ms-transform: translateY(-50%) scale(1);

-o-transform: translateY(-50%) scale(1);

transform: translateY(-50%) scale(1);

opacity: 1;

}

40% {

-webkit-transform: translateY(-50%) scale(0.9);

-moz-transform: translateY(-50%) scale(0.9);

-ms-transform: translateY(-50%) scale(0.9);

-o-transform: translateY(-50%) scale(0.9);

transform: translateY(-50%) scale(0.9);

opacity: 0;

}

100% {

-webkit-transform: translateY(-50%) scale(0);

-moz-transform: translateY(-50%) scale(0);

-ms-transform: translateY(-50%) scale(0);

-o-transform: translateY(-50%) scale(0);

transform: translateY(-50%) scale(0);

opacity: 0;

}

}

<!-- Second CSS code -->

<style>

.cd-intro {

width: 100%;

max-width: 1468px;

text-align: center;

padding-top: 0.3em;

padding-bottom: 0.3em;

} </style>

 

<script src="js/modernizr.js"></script> <!-- Modernizr -->

</head>

<body>

<section class="cd-intro">

<h1 class="cd-headline clip is-full-width">

<span>At Fleurlovin, you'll find</span>

<span class="cd-words-wrapper">

<b class="is-visible">luxury</b>

<b>innovation</b>

<b>comfort</b>

<b>elegance</b>

<b>inspiration</b>

<b>excitement</b>

<b>quality</b>

<b>sophistication</b>

<b>diversity</b>

<b>originality</b>

</span>

</h1>

</section> <!-- cd-intro -->

 

<script src="js/jquery-2.1.1.js"></script>

<script src="js/main.js"></script> <!-- Resource jQuery -->

 

<script>

jQuery(document).ready(function($){

//set animation timing

var animationDelay = 2500,

//loading bar effect

barAnimationDelay = 3800,

barWaiting = barAnimationDelay - 3000, //3000 is the duration of the transition on the loading bar - set in the scss/css file

//letters effect

lettersDelay = 50,

//type effect

typeLettersDelay = 150,

selectionDuration = 500,

typeAnimationDelay = selectionDuration + 800,

//clip effect

revealDuration = 600,

revealAnimationDelay = 1500;

 

initHeadline();

 

 

function initHeadline() {

//insert <i> element for each letter of a changing word

singleLetters($('.cd-headline.letters').find('b'));

//initialise headline animation

animateHeadline($('.cd-headline'));

}

 

function singleLetters($words) {

$words.each(function(){

var word = $(this),

letters = word.text().split(''),

selected = word.hasClass('is-visible');

for (i in letters) {

if(word.parents('.rotate-2').length > 0) letters[i] = '<em>' + letters[i] + '</em>';

letters[i] = (selected) ? '<i class="in">' + letters[i] + '</i>': '<i>' + letters[i] + '</i>';

}

var newLetters = letters.join('');

word.html(newLetters).css('opacity', 1);

});

}

 

function animateHeadline($headlines) {

var duration = animationDelay;

$headlines.each(function(){

var headline = $(this);

 

if(headline.hasClass('loading-bar')) {

duration = barAnimationDelay;

setTimeout(function(){ headline.find('.cd-words-wrapper').addClass('is-loading') }, barWaiting);

} else if (headline.hasClass('clip')){

var spanWrapper = headline.find('.cd-words-wrapper'),

newWidth = spanWrapper.width() + 10

spanWrapper.css('width', newWidth);

} else if (!headline.hasClass('type') ) {

//assign to .cd-words-wrapper the width of its longest word

var words = headline.find('.cd-words-wrapper b'),

width = 0;

words.each(function(){

var wordWidth = $(this).width();

if (wordWidth > width) width = wordWidth;

});

headline.find('.cd-words-wrapper').css('width', width);

};

 

//trigger animation

setTimeout(function(){ hideWord( headline.find('.is-visible').eq(0) ) }, duration);

});

}

 

function hideWord($word) {

var nextWord = takeNext($word);

 

if($word.parents('.cd-headline').hasClass('type')) {

var parentSpan = $word.parent('.cd-words-wrapper');

parentSpan.addClass('selected').removeClass('waiting');

setTimeout(function(){

parentSpan.removeClass('selected');

$word.removeClass('is-visible').addClass('is-hidden').children('i').removeClass('in').addClass('out');

}, selectionDuration);

setTimeout(function(){ showWord(nextWord, typeLettersDelay) }, typeAnimationDelay);

 

} else if($word.parents('.cd-headline').hasClass('letters')) {

var bool = ($word.children('i').length >= nextWord.children('i').length) ? true : false;

hideLetter($word.find('i').eq(0), $word, bool, lettersDelay);

showLetter(nextWord.find('i').eq(0), nextWord, bool, lettersDelay);

 

} else if($word.parents('.cd-headline').hasClass('clip')) {

$word.parents('.cd-words-wrapper').animate({ width : '2px' }, revealDuration, function(){

switchWord($word, nextWord);

showWord(nextWord);

});

 

} else if ($word.parents('.cd-headline').hasClass('loading-bar')){

$word.parents('.cd-words-wrapper').removeClass('is-loading');

switchWord($word, nextWord);

setTimeout(function(){ hideWord(nextWord) }, barAnimationDelay);

setTimeout(function(){ $word.parents('.cd-words-wrapper').addClass('is-loading') }, barWaiting);

 

} else {

switchWord($word, nextWord);

setTimeout(function(){ hideWord(nextWord) }, animationDelay);

}

}

 

function showWord($word, $duration) {

if($word.parents('.cd-headline').hasClass('type')) {

showLetter($word.find('i').eq(0), $word, false, $duration);

$word.addClass('is-visible').removeClass('is-hidden');

 

} else if($word.parents('.cd-headline').hasClass('clip')) {

$word.parents('.cd-words-wrapper').animate({ 'width' : $word.width() + 10 }, revealDuration, function(){

setTimeout(function(){ hideWord($word) }, revealAnimationDelay);

});

}

}

 

function hideLetter($letter, $word, $bool, $duration) {

$letter.removeClass('in').addClass('out');

 

if(!$letter.is(':last-child')) {

setTimeout(function(){ hideLetter($letter.next(), $word, $bool, $duration); }, $duration);

} else if($bool) {

setTimeout(function(){ hideWord(takeNext($word)) }, animationDelay);

}

 

if($letter.is(':last-child') && $('html').hasClass('no-csstransitions')) {

var nextWord = takeNext($word);

switchWord($word, nextWord);

}

}

 

function showLetter($letter, $word, $bool, $duration) {

$letter.addClass('in').removeClass('out');

 

if(!$letter.is(':last-child')) {

setTimeout(function(){ showLetter($letter.next(), $word, $bool, $duration); }, $duration);

} else {

if($word.parents('.cd-headline').hasClass('type')) { setTimeout(function(){ $word.parents('.cd-words-wrapper').addClass('waiting'); }, 200);}

if(!$bool) { setTimeout(function(){ hideWord($word) }, animationDelay) }

}

}

 

function takeNext($word) {

return (!$word.is(':last-child')) ? $word.next() : $word.parent().children().eq(0);

}

 

function takePrev($word) {

return (!$word.is(':first-child')) ? $word.prev() : $word.parent().children().last();

}

 

function switchWord($oldWord, $newWord) {

$oldWord.removeClass('is-visible').addClass('is-hidden');

$newWord.removeClass('is-hidden').addClass('is-visible');

}

});

</script>

</body>

</html>

 

{% schema %}

{

"name": "Slick Slider",

"settings": [

{

"type": "text",

"id": "heading",

"label": "Heading",

"default": "My Custom Heading"

},

{

"type": "select",

"id": "color_scheme",

"options": [

{

"value": "accent-1",

"label": "t:sections.all.colors.accent_1.label"

},

{

"value": "accent-2",

"label": "t:sections.all.colors.accent_2.label"

},

{

"value": "background-1",

"label": "t:sections.all.colors.background_1.label"

},

{

"value": "background-2",

"label": "t:sections.all.colors.background_2.label"

},

{

"value": "inverse",

"label": "t:sections.all.colors.inverse.label"

}

],

"default": "background-1",

"label": "t:sections.all.colors.label",

"info": "t:sections.all.colors.has_cards_info"

}

],

"presets": [

{

"name": "Slick Slider"

}

]

}

{% endschema %}