#88 - Afficher l'état actuel du CMS, liens vers les dossiers

Affichez l'état "actuel" du Webflow sur vos pages imbriquées et les éléments du CMS.

Video Tutorial

Loom
tutorial.mov

Watch the video for step-by-step implementation instructions

The Code

14 lines
Paste this into Webflow
<!-- 💙 MEMBERSCRIPT #88 v0.1 💙 SHOW CURRENT STATE FOR NESTED URLS -->
<script>
window.onload = function() {
  var currentUrl = window.location.href;
  var elements = document.querySelectorAll('[ms-code-nested-link]'); // get all elements with ms-code-nested-link attribute

  elements.forEach(function (element) {
    var linkAttrValue = element.getAttribute('ms-code-nested-link'); // get the ms-code-nested-link value
    if (currentUrl.includes(linkAttrValue)) { // check keywordif current url matches the attribute value
      element.classList.add('w--current'); // apply the keywordclass 
    }
  });
};
</script>

Script Info

Versionv0.1
PublishedNov 11, 2025
Last UpdatedNov 11, 2025

Need Help?

Join our Slack community for support, questions, and script requests.

Join Slack Community
Back to All Scripts

Related Scripts

More scripts in UX