Jump to content

Why are my YUI id's changing in 7.1?

Recommended Posts

I'm trying to target images inside an element with a YUI id for css manipulation, however the YUI id is changing when the page reloads.

Repro steps:

  1. Inspect element
  2. find wrapper with YUI id
  3. Open custom css editor
  4. add "#yui ... id number" and styling code
  5. watch the styling apply correctly in real-time
  6. save changes
  7. reload page
  8. styles are no longer applied because after inspecting the same element, the YUI id has dynamically changed

Is this expected behavior? If so, what is the change to my workflow that i need to consider?


Link to comment
  • Replies 6
  • Views 4.7k
  • Created
  • Last Reply

@tuanphan that worked for a single image, and i'm trying to address changes to a section of images. So your insight gave me an idea to use #page-section-idXXX" .. which seems to have done the trick. Is that an acceptable practice? 


Link to comment
1 hour ago, SKYW4KR said:

So your insight gave me an idea to use #page-section-idXXX" .. which seems to have done the trick. Is that an acceptable practice? 


Here's my guide to the IDs you should and shouldn't use: In Squarespace, what are the differences between #block-yui and #yui selectors?

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Link to comment
  • 1 month later...

@SKYW4KR Did you figure this out? I am trying to stop the links for about 80% of the images/titles on my blog summary post, but there is no block ID for each image/title, they are all yui ids that change each time. I tried disabling the whole summary's links then just forcing the 12 I do need to work... but... 

My code is as follows with the bold part being what changes (of course) and doesn't work. 

 //remove link in staff blog
div#block-yui_3_17_2_1_1590076520498_4551 .summary-title-link {
    pointer-events: none;
//add link to jordans profile
#yui_3_17_2_1_1591131927780_981 .summary-title-link {pointer-events: auto!important;}   <--- no block ID that I can see for this image


Thoughts? I

Link to comment


This topic is now archived and is closed to further replies.

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