Romivdl Posted October 7, 2021 Share Posted October 7, 2021 Site URL: https://www.romivanderlinden.nl I have been trying to change the order on the mobile version, on desktop version everything is fine. On phone the order is : 01. beautyboosters 03. rpd the vertical line 02. butterfly 04. material research More work button - But I would like to have: 01. beautyboosters 02. butterfly 03. rpd 04. material research the vertical line More work button Is there a way to fix this? I also have this issue on the following pages: https://www.romivanderlinden.nl/photography https://www.romivanderlinden.nl/graphic-design As in on desktop it is from 1, 2, 3, 4... etc.. and on mobile it is 1, 4, 7, 10 etc.. Thanks in advance! Link to comment
Beyondspace Posted October 10, 2021 Share Posted October 10, 2021 On 10/7/2021 at 5:31 PM, Romivdl said: Site URL: https://www.romivanderlinden.nl I have been trying to change the order on the mobile version, on desktop version everything is fine. On phone the order is : 01. beautyboosters 03. rpd the vertical line 02. butterfly 04. material research More work button - But I would like to have: 01. beautyboosters 02. butterfly 03. rpd 04. material research the vertical line More work button Is there a way to fix this? I also have this issue on the following pages: https://www.romivanderlinden.nl/photography https://www.romivanderlinden.nl/graphic-design As in on desktop it is from 1, 2, 3, 4... etc.. and on mobile it is 1, 4, 7, 10 etc.. Thanks in advance! Why don't you use the Gallery section that make it easier to order your title and image? BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
Romivdl Posted October 11, 2021 Author Share Posted October 11, 2021 On 10/10/2021 at 3:47 AM, bangank36 said: Why don't you use the Gallery section that make it easier to order your title and image? I tried with gallery, but it didn't go specifically how I wanted it. So I added each text + image individually. Which works, only not for mobile version sadly. So if you have a solution, let me know! Thanks any how. Link to comment
Beyondspace Posted October 11, 2021 Share Posted October 11, 2021 1 hour ago, Romivdl said: I tried with gallery, but it didn't go specifically how I wanted it. So I added each text + image individually. Which works, only not for mobile version sadly. So if you have a solution, let me know! Thanks any how. I may come up with a js solution for this, Romivdl 1 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
Beyondspace Posted October 15, 2021 Share Posted October 15, 2021 (edited) Step 1: Home > Settings > Advanced > Code injection > footer <script> /**Create Mobile Node**/ const section = 'section[data-section-id="613a343c224a8356765c6354"]'; const sectionEl = document.querySelector(section); const imageBlocks = sectionEl.querySelectorAll(".image-block"); const htmlBlocks = Array.from(imageBlocks).map((img) => { const htmlBlock = img.nextSibling; return htmlBlock; }); /*set html and img into new array, each item in array is object with img and text block*/ let sectionMobileList = []; const sectionLength = Math.min(htmlBlocks.length, imageBlocks.length); for (let i = 0; i < sectionLength; i++) { sectionMobileList.push({ img: imageBlocks[i].cloneNode([true]), text: htmlBlocks[i].cloneNode([true]) }); } /* sort array with text in text block */ sectionMobileList.sort((a, b) => { return parseInt(a.text.textContent.substring(0, 2)) - parseInt(b.text.textContent.substring(0, 2)); }) /*generate html node for mobile*/ const htmlMobileWrap = document.createElement('div'); htmlMobileWrap.classList.add('mobile-Wrapper'); sectionMobileList.forEach(item => { const htmlItem = document.createElement('div'); htmlItem.classList.add('mobile-item'); htmlItem.insertAdjacentElement('beforeend', item.img); htmlItem.insertAdjacentElement('beforeend', item.text); htmlMobileWrap.insertAdjacentElement('beforeend', htmlItem) }) const htmlMobileSection = sectionEl.querySelector('.content-wrapper > .content'); htmlMobileSection.insertAdjacentElement('beforeend', htmlMobileWrap); /* add more work Btn */ const workBtn = document.querySelector('#block-yui_3_17_2_1_1631737855583_9368').cloneNode([true]); htmlMobileWrap.insertAdjacentElement('beforeend', workBtn); </script> Step 2: Home > Design > Custom Css /*Mobile wrapper*/ @media only screen and (max-width: 767px) { section[data-section-id="613a343c224a8356765c6354"] .content-wrapper .content > .sqs-layout { display: none; } } @media only screen and (min-width: 768px) { section[data-section-id="613a343c224a8356765c6354"] .content-wrapper .content > .mobile-Wrapper { display: none; } } Hope work properly on your site Support me by pressing 👍 if this useful for you Edited October 15, 2021 by bangank36 tuanphan 1 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
Romivdl Posted October 18, 2021 Author Share Posted October 18, 2021 On 10/15/2021 at 3:06 PM, bangank36 said: Step 1: Home > Settings > Advanced > Code injection > footer <script> /**Create Mobile Node**/ const section = 'section[data-section-id="613a343c224a8356765c6354"]'; const sectionEl = document.querySelector(section); const imageBlocks = sectionEl.querySelectorAll(".image-block"); const htmlBlocks = Array.from(imageBlocks).map((img) => { const htmlBlock = img.nextSibling; return htmlBlock; }); /*set html and img into new array, each item in array is object with img and text block*/ let sectionMobileList = []; const sectionLength = Math.min(htmlBlocks.length, imageBlocks.length); for (let i = 0; i < sectionLength; i++) { sectionMobileList.push({ img: imageBlocks[i].cloneNode([true]), text: htmlBlocks[i].cloneNode([true]) }); } /* sort array with text in text block */ sectionMobileList.sort((a, b) => { return parseInt(a.text.textContent.substring(0, 2)) - parseInt(b.text.textContent.substring(0, 2)); }) /*generate html node for mobile*/ const htmlMobileWrap = document.createElement('div'); htmlMobileWrap.classList.add('mobile-Wrapper'); sectionMobileList.forEach(item => { const htmlItem = document.createElement('div'); htmlItem.classList.add('mobile-item'); htmlItem.insertAdjacentElement('beforeend', item.img); htmlItem.insertAdjacentElement('beforeend', item.text); htmlMobileWrap.insertAdjacentElement('beforeend', htmlItem) }) const htmlMobileSection = sectionEl.querySelector('.content-wrapper > .content'); htmlMobileSection.insertAdjacentElement('beforeend', htmlMobileWrap); /* add more work Btn */ const workBtn = document.querySelector('#block-yui_3_17_2_1_1631737855583_9368').cloneNode([true]); htmlMobileWrap.insertAdjacentElement('beforeend', workBtn); </script> Step 2: Home > Design > Custom Css /*Mobile wrapper*/ @media only screen and (max-width: 767px) { section[data-section-id="613a343c224a8356765c6354"] .content-wrapper .content > .sqs-layout { display: none; } } @media only screen and (min-width: 768px) { section[data-section-id="613a343c224a8356765c6354"] .content-wrapper .content > .mobile-Wrapper { display: none; } } Hope work properly on your site Support me by pressing 👍 if this useful for you This works absolutely perfectly! A huge thanks!! Couldn't have worked out it otherwise!! Thankyou!! Link to comment
AndreaDube Posted February 18, 2022 Share Posted February 18, 2022 hi @bangank36, is there possibly a way to use this solution with buttons? For example, https://www.spivafordcag.com/issues Link to comment
tuanphan Posted February 21, 2022 Share Posted February 21, 2022 On 2/18/2022 at 10:46 PM, AndreaDube said: hi , is there possibly a way to use this solution with buttons? For example, https://www.spivafordcag.com/issues Which order you want on mobile? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment