Tuesday, October 6, 2020

Today, we are deploying a change to our "Unique ID" functionality in v2 content blocks which may result in broken anchor IDs due to the changes in how the final IDs are generated and output in the page's HTML.

Originally, this feature would allow editors to create an ID for the content block that could be used for anchor links. However, this feature was not easy or reliable to use. The value given by the editor was modified on page render to remove spaces, special characters and to make sure it was unique within the page by appending a number at the end if it found an existing id that matched. Ultimately, without looking at the HTML markup, editors didn't know for sure what ID to use for anchor links elsewhere.

Going forward the Unique ID functionality in v2 works like this:

  • An editor enters a value which shows the final clean ID after focus is removed from the field.
  • The value is updated on page save to be the same ID as in the help text and is saved to the database.
  • Once the content block is saved again, the collapsed content block previews display the ID for quick retrieval.

Existing values won't be updated until the content block is saved, but the IDs within the HTML markup will be updated as soon as page caches clear. We realize this last bit could cause issues with existing content, but that the existing functionality was causing inconsistencies to the point where it was unusable.

Check out our content block and wysiwyg documentation regarding Unique IDs and anchor links.