TrueNatureDreams Posted March 8, 2023 Share Posted March 8, 2023 I am looking to add a new section to a blog post but it doesn't seem possible. Does anyone know any code to make this happen? I spoke to Squarespace and it seems like Fluid Engine isn't live for blogs yet. I would like a header banner across the top before I begin the main body of the blog post. I've added a screenshot of what I'd like to recreate. Squarespace suggested using spacers but that won't allow a full-bleed banner image at the top of the page. Can anyone help? Thanks in advance. Link to comment
Solution iamdavehart Posted March 8, 2023 Solution Share Posted March 8, 2023 You can do this in a couple of ways. in both cases I assume you only want to do this on a blog, so you could either use post blog code injection (might be premium feature, can't remember) and add a style block with the css in, or you can find the collection id of your blog using the squarespaceid finder and modify the css selector for that. I'd recommend post blog code injection (click advanced on the settings of the blog you want to do this to) Simple CSS: (Fixed Height) Adding a css block that is coloured in a certain way and is of a fixed height is pretty easy. this has a fixed height of 500px; main article.sections section:nth-child(1) .section-border .section-background::before { content:''; background:lightblue; position:absolute; top:0; left:0; right:0; height:500px; display:block; } Complex / Obtuse(!) CSS: (Height that flexes with the title) the difficult part is if you want it to grow relative to your title block. in the picture for example you've got a 2-line title. a fixed width box isn't going to line up correctly. so for that option you have to try something more difficult. Essentially you have to find the element that has the blog header and do some css trickery to play with a box shadow. so, if you add this you should find that you get a light blue background that flexes with the size of the title/metadata holder main article.sections .blog-item-top-wrapper { background-color: lightblue; box-shadow: 0 0 0 100vmax lightblue; clip-path:inset(-100vh -100vw -100px -100vw); z-index:1; } to make this work in your style, you should change the "lightblue" in both places to the colour you want, and then change the third number "-100px" to whatever you want your padding to be (the space between the bottom of the title block and where the colour finishes. note that it is a negative number. TrueNatureDreams 1 Dave Hart. Software/Technology Consultant living in London. buymeacoffee Link to comment
TrueNatureDreams Posted March 12, 2023 Author Share Posted March 12, 2023 Thank you so much for you help @iamdavehartI really appreciate you taking the time to answer my question. This has worked really well and provides exactly what I was looking for, now to work out how to layer an image within the section. Thanks again, you're a total star. Link to comment
Mary_DG Posted November 28, 2023 Share Posted November 28, 2023 Hello, related to this topic about adding a section on squarespace blog page. I need to add a form below the blog links on every blog page but I don't have a way to add a section. The form is the same format that I have on every other page on this site: www.hellocinnamon.com I need to add the same form format to the individual blog pages. Link to comment
tuanphan Posted November 29, 2023 Share Posted November 29, 2023 On 11/28/2023 at 8:41 AM, Mary_DG said: Hello, related to this topic about adding a section on squarespace blog page. I need to add a form below the blog links on every blog page but I don't have a way to add a section. The form is the same format that I have on every other page on this site: www.hellocinnamon.com I need to add the same form format to the individual blog pages. You can add it to Site Footer, then we can give jQuery code to move its position Or use plugin. I used to help some sites to achieve same cases, by using section in footer or plugin 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
Mary_DG Posted November 29, 2023 Share Posted November 29, 2023 6 hours ago, tuanphan said: You can add it to Site Footer, then we can give jQuery code to move its position Or use plugin. I used to help some sites to achieve same cases, by using section in footer or plugin Thanks, Tuanphan. but by adding it to the footer will it not appear on other pages too? If you can provide me the Jquery code, I can try it out and get back to you. As always thank you for your help. Link to comment
tuanphan Posted December 1, 2023 Share Posted December 1, 2023 On 11/29/2023 at 10:32 PM, Mary_DG said: Thanks, Tuanphan. but by adding it to the footer will it not appear on other pages too? If you can provide me the Jquery code, I can try it out and get back to you. As always thank you for your help. Yes. Adding to Footer will appear, but then we can use CSS to hide it on all pages. Currently I don't have code for Section in Site Footer, you can add it then share site url, we can check & give you code (if the site is live & you can't add it, you can duplicate the site & do there) With plugin, I used Section Loader Supreme plugin then use this code to Code Injection Footer First install plugin Next, create a page in Not Linked with Name (any name) - URL: above-footer Next, add your form into Not Linked Page Next, add this code to Blog Page Header Code Injection <div data-wm-plugin="load" data-target="/above-footer"></div> And add this code to Code Injection > Footer <script> $(document).ready(function(){ setTimeout( function() { $('div.wm-load-container').insertBefore('body[class*="type-blog"].view-item footer.sections'); }, 3000); }); </script> The code will add Not Linked Page Section above Footer on Blog Post Only 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