Jump to content

Add blank section to blog post

Go to solution Solved by iamdavehart,

Recommended Posts

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.

 

Screenshot 2023-03-08 at 12.46.49.png

Link to comment
  • Solution

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.

 

 

Dave Hart. Software/Technology Consultant living in London. buymeacoffee 

Link to comment
  • 8 months later...

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
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
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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.