Move Email Signup Blocks

Solved

Move Email Signup Blocks

mayami
New Member
5 0 0

I'm using the Dawn theme. I wish to place my Email Signup beside my Footer content, but only for my desktop view. Is this possible and how do I do that?

 

Ideal look on Desktop:

Ideal email.PNG

 

How it currently looks on Desktop:

Desktop email.PNG

 

How it currently looks on Mobile and I don't want to change this:

Mobile email.PNG

 

Thank you in advance!

Accepted Solution (1)
vinh0225
Shopify Partner
128 26 25

This is an accepted solution.

Hi @mayami 

 

Please follow these steps:

1. From your Shopify admin, go to Online Store > Themes.
2. Find the theme that you want to edit, click the ... button to open the actions menu, and then click Edit code.
3. Open the file layout/theme.liquid and add the following snippets before </body>.

 

<script>
document.addEventListener('DOMContentLoaded', function() {
  if (window.matchMedia("(min-width: 1024px)").matches) {
    const elementToMove = document.querySelector('.newsletter__wrapper');
    elementToMove.style.padding = "0 0 10px";
    const originalParent = elementToMove.parentNode;
    const newParents = document.querySelectorAll('.footer-block.grid__item.scroll-trigger.animate--slide-in');
    const thirdNewParent = newParents[2];
    const firstChildOfNewParent = thirdNewParent.firstElementChild;
    originalParent.removeChild(elementToMove);
    thirdNewParent.insertBefore(elementToMove, firstChildOfNewParent);
  }
});
</script>

 

 

 

That's it. Please let me know if you have any concern.

Was my response useful?  Click Like to let me know!
Was your query resolved? ✓ Mark it as a Resolved Solution
If you need custom Shopify changes, ️you can hire me.
Contact me at  ✉️ jalicorich@gmail.com.

View solution in original post

Replies 10 (10)

vinh0225
Shopify Partner
128 26 25

Hi @mayami 

Could you please share your store URL so that I can investigate further?

Was my response useful?  Click Like to let me know!
Was your query resolved? ✓ Mark it as a Resolved Solution
If you need custom Shopify changes, ️you can hire me.
Contact me at  ✉️ jalicorich@gmail.com.
mayami
New Member
5 0 0

Thank you for replying! Here it is..

Site: https://www.amiamiclub.com/

Password: ami5aug

vinh0225
Shopify Partner
128 26 25

This is an accepted solution.

Hi @mayami 

 

Please follow these steps:

1. From your Shopify admin, go to Online Store > Themes.
2. Find the theme that you want to edit, click the ... button to open the actions menu, and then click Edit code.
3. Open the file layout/theme.liquid and add the following snippets before </body>.

 

<script>
document.addEventListener('DOMContentLoaded', function() {
  if (window.matchMedia("(min-width: 1024px)").matches) {
    const elementToMove = document.querySelector('.newsletter__wrapper');
    elementToMove.style.padding = "0 0 10px";
    const originalParent = elementToMove.parentNode;
    const newParents = document.querySelectorAll('.footer-block.grid__item.scroll-trigger.animate--slide-in');
    const thirdNewParent = newParents[2];
    const firstChildOfNewParent = thirdNewParent.firstElementChild;
    originalParent.removeChild(elementToMove);
    thirdNewParent.insertBefore(elementToMove, firstChildOfNewParent);
  }
});
</script>

 

 

 

That's it. Please let me know if you have any concern.

Was my response useful?  Click Like to let me know!
Was your query resolved? ✓ Mark it as a Resolved Solution
If you need custom Shopify changes, ️you can hire me.
Contact me at  ✉️ jalicorich@gmail.com.
mayami
New Member
5 0 0

Hi Vinh, it worked on desktop. Thank you so much!

 

It also changed the arrangement for mobile view. Is it possible to get the Email Signup as the first block?

 

How it looks now:

mayami_1-1722836737808.png

 

Ideal look on Mobile:

mayami_0-1722836715163.png

 

vinh0225
Shopify Partner
128 26 25

Hi Mayami,

 

It seems like the store password updated. Please provide me with the new password via private message.

 

Regards,

Vinh

Was my response useful?  Click Like to let me know!
Was your query resolved? ✓ Mark it as a Resolved Solution
If you need custom Shopify changes, ️you can hire me.
Contact me at  ✉️ jalicorich@gmail.com.
mayami
New Member
5 0 0

Hi Vinh, I can't find a way to DM you. I've changed the password back to ami5aug, please try again. Thank you.

vinh0225
Shopify Partner
128 26 25

Hi @mayami 

Yeah, I can see the store again.

By the way, did you try to refresh page when you toggle to mobile from desktop mode?
The code works when it loads a page. So when you change screen size in browser, the updates remains as it was.
So you need to refresh the page to see a correct result after toggling the screen mode.

Was my response useful?  Click Like to let me know!
Was your query resolved? ✓ Mark it as a Resolved Solution
If you need custom Shopify changes, ️you can hire me.
Contact me at  ✉️ jalicorich@gmail.com.
mayami
New Member
5 0 0

As connected via DM, thank you so much for the help, Vinh!! 🌻

Yakuman
Visitor
1 0 0

Hi, I added the script into the the Dawn theme.liquid.

    {% comment %} Move Email Signup from Section to Block {% endcomment %}
    <script>
      document.addEventListener('DOMContentLoaded', function() {
        if (window.matchMedia("(min-width: 1024px)").matches) {
          const elementToMove = document.querySelector('.newsletter__wrapper');
          elementToMove.style.padding = "0 0 10px";
          const originalParent = elementToMove.parentNode;
          const newParents = document.querySelectorAll('.footer-block.grid__item.scroll-trigger.animate--slide-in');
          const thirdNewParent = newParents[2];
          const firstChildOfNewParent = thirdNewParent.firstElementChild;
          originalParent.removeChild(elementToMove);
          thirdNewParent.insertBefore(elementToMove, firstChildOfNewParent);
      }
    });
    </script>

  </body>
</html>

 Like so as per your instruction but the Newsletter still sits as it own section instead of being a block.
See screenshot.

problem-1.jpg

vinh0225
Shopify Partner
128 26 25

Hi @Yakuman 

The solution vary from site to site. Please let me know your website URL and your requirement in detail.

You could message me via DM.

Was my response useful?  Click Like to let me know!
Was your query resolved? ✓ Mark it as a Resolved Solution
If you need custom Shopify changes, ️you can hire me.
Contact me at  ✉️ jalicorich@gmail.com.