melaniejaane Posted December 6, 2022 Share Posted December 6, 2022 So I'm trying to change the order of content in my summary block to: 1. Title 2. Primary Metadata (Categories) 3. Blog Excerpt 4. Secondary Metadata (Tags) The css I've created below successfully does this on all blocks except the Metadata, because they are in a lower class. Is there a way to take Primary and Secondary Metadata out of their shared class, so they can be treated as independent elements like the summary title and excerpt? .summary-content.sqs-gallery-meta-container , .summary-content.sqs-gallery-meta-container .summary-metadata-container.summary-metadata-container--below-title { display: flex; flex-wrap: wrap;} .summary-title{ order:1!important;} .summary-metadata.summary-metadata--primary{ order:2!important;} .summary-excerpt{order:3!important;} .summary-metadata.summary-metadata--secondary{order:4!important;} Website: https://www.beehyve.health/resourcesPassword: abc Link to comment
Beyondspace Posted December 7, 2022 Share Posted December 7, 2022 14 hours ago, melaniejaane said: So I'm trying to change the order of content in my summary block to: 1. Title 2. Primary Metadata (Categories) 3. Blog Excerpt 4. Secondary Metadata (Tags) The css I've created below successfully does this on all blocks except the Metadata, because they are in a lower class. Is there a way to take Primary and Secondary Metadata out of their shared class, so they can be treated as independent elements like the summary title and excerpt? .summary-content.sqs-gallery-meta-container , .summary-content.sqs-gallery-meta-container .summary-metadata-container.summary-metadata-container--below-title { display: flex; flex-wrap: wrap;} .summary-title{ order:1!important;} .summary-metadata.summary-metadata--primary{ order:2!important;} .summary-excerpt{order:3!important;} .summary-metadata.summary-metadata--secondary{order:4!important;} Website: https://www.beehyve.health/resourcesPassword: abc This is the standard layout of Dom on summary block: The 'summary-metadata--primary' and 'summary-metadata--secondary' are not on the same level with the title and excerpt. If you require this order, we need to implement js code to change some Dom element on summary block and set the right Css style for it. tuanphan 1 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - Lightbox captions only mode) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace 🚀 Learn how to rank new pages on Google in 48 hours! 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
melaniejaane Posted May 3, 2023 Author Share Posted May 3, 2023 On 12/8/2022 at 3:42 AM, Beyondspace said: This is the standard layout of Dom on summary block: The 'summary-metadata--primary' and 'summary-metadata--secondary' are not on the same level with the title and excerpt. If you require this order, we need to implement js code to change some Dom element on summary block and set the right Css style for it. Thanks for your insight @Beyondspace Is it relatively easy to set up JS code like this? I'm familiar with CSS and html but novice with JS. Do you know of any similar snippets I could use as a base? Thanks so much 🙂 Link to comment
margothermans Posted September 19 Share Posted September 19 (edited) This might be a bit late (maybe others are looking) but this worked for me: <script> document.addEventListener("DOMContentLoaded", function() { summaryItems.forEach(function(item) { // Move the primary metadata (date) above the title var primaryMetadata = item.querySelector(".summary-metadata--primary"); var title = item.querySelector(".summary-title"); if (primaryMetadata && title) { title.parentNode.insertBefore(primaryMetadata, title); } // Move the secondary metadata (tags) below the excerpt var secondaryMetadata = item.querySelector(".summary-metadata--secondary"); var excerpt = item.querySelector(".summary-excerpt"); if (secondaryMetadata && excerpt) { excerpt.parentNode.insertBefore(secondaryMetadata, excerpt.nextSibling); } }); }); </script> Edited September 19 by margothermans 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