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?

-lh

Link to comment
  • Replies 6
  • 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? 

TYIA!!

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? 

Yes.

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?

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is 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

Archived

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.