Wagtail client-side components
    Preparing search index...

    Function getElementByContentPath

    • Get the content element based on a given content path (or one extracted from the URL hash fragment).

      Parameters

      • OptionalcontentPath: string

        (optional) content path to the content element. If not provided, it will be extracted from the URL fragment.

      Returns null | HTMLElement

      the content element, if found, otherwise null.

      getElementByContentPath('abc1.d2e.3f')
      // returns <div data-contentpath="3f">...</div>
      getElementByContentPath()
      // with an URL e.g. https://example.com/#:w:contentpath=abc1.d2e.3f
      // returns <div data-contentpath="3f">...</div>