Jump to content

When Blocks and Sections are assigned IDs?

Go to solution Solved by Ziggy,

Recommended Posts

I've worked on maybe 8-10 Squarespace sites injecting custom css and code into previously published websites, but now I'm working on one that hasn't been published yet and it almost seems too...easy?

By that I mean I'm using actual class names, instead of something like this

.block-id123456789 {custom css}

I'm able to use actual class names like so:

.header-nav-list {custom css}

Is there a point in time when block IDs and section IDs are actually assigned? I'm glad I'm getting all of my code to work now, but I'm nervous that when the time comes for blocks and sections to have IDs, especially for custom JS and using querySelect(), that I'm going to have to put a lot of hours into redoing everything I've done so far.

Edited by jdb99
Link to comment
  • Replies 1
  • Views 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Solution
40 minutes ago, jdb99 said:
.block-id123456789

This is for a block.

40 minutes ago, jdb99 said:
.header-nav-list 

This is a global class.

Blocks will always have a unique block ID, which is generated when you create the block.

All of the global elements, header components, footer, block types etc. have classes and IDs like .header-nav-list or .sqs-block .image-block

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️ Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

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.