Jump to content

Why are my YUI id's changing in 7.1?

Go to solution Solved by paul2009,

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

@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
  • Solution
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?

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Buy me a coffee

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

Edited by deaton72
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.