Add drupalSettings.xbData.v0 reference to starterComponentTemplate.ts

Created on 1 July 2025, 3 days ago

Overview

After working on πŸ“Œ Populate data to drupalSettings to enable Dynamic Code Components Active (and be merged into 0.x), we've exposed drupalSettings to code components.

Users should be aware that this can be used.

Proposed resolution

The available options are:

drupalSettings.xbData.v0.baseUrl (string)
drupalSettings.xbData.v0.branding (array[homeUrl, siteName, siteSlogan])
drupalSettings.xbData.v0.breadcrumbs (array of arrays(key, text, url))
drupalSettings.xbData.v0.pageTitle (string)

User interface changes

✨ Feature request
Status

Active

Version

0.0

Component

… to be triaged

Created by

πŸ‡ͺπŸ‡ΈSpain isholgueras

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @isholgueras
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί
  • πŸ‡³πŸ‡±Netherlands balintbrews Amsterdam, NL

    We will expose simple functions for code component authors to retrieve data from drupalSettings.xbData, so they don't need to deal with the Drupalism that is window.drupalSettings. Our initial discussion concluded that for title and breadcrumb, we'll most likely have a getPageData() function, and getSiteData() for base URL and branding. The issue(s) to make these happen are yet to be created. Nevertheless, good call to have some explanation added in the starter component template. Which is getting really long, so we'll want to link to online docs, but that's another issue that we'll need to create and work on. πŸ™‚

Production build 0.71.5 2024