id
attributes (e.g., subtopic-{{slug}}
) to target elements in the CMS collection.#subtopic-{{slug}}
and enable smooth scrolling via CSS in Page Settings.To create scroll buttons on a CMS page in Webflow that link to specific subtopics in a collection list with dynamically generated IDs, follow these steps to generate and connect dynamic anchor links.
ID
attribute to the element you want to scroll to (e.g., an H2 heading or a div
).id
slug
or a combination like subtopic-{{slug}}
.Example: If your Slug field is "history", the resulting ID would be "subtopic-history".
#subtopic-{{slug}}
Prepend the CMS Slug with #subtopic-
to match the ID set earlier.
<style>html { scroll-behavior: smooth; }</style>
Create dynamic IDs on CMS subtopics using the Slug field, and link to those with hash anchor links like #subtopic-{{slug}}
. This setup enables in-page scrolling to specific CMS-generated content.