A storefront site runs its own cartridge path, and two sites on one instance can resolve the same require to different files. A site scope tells the IDE which site you are working on, so it follows that site's cartridge order the way the server does
Pick a site
Open B2C Site Scopes
Click the site scope widget in the status bar. It reads Global scope, or the selected site with the number of cartridges on its path, for example "AcmeUS (4)"
Look at the sites
The B2C Site Scopes popup lists the sites from your active instance and from your project. Hover a site and its card opens at once, beside the popup: the site, its ID or source, how many cartridges are linked and not linked, and its cartridge path in up to three columns
Select one
Click a site. Open files are re-analyzed and navigation follows its cartridge path. Choose Global scope to go back to every linked cartridge
Where the sites come from
| Section | Lists | Needs |
|---|---|---|
| Remote instance: Sandbox 01 | The sites of the active connection, with the cartridge path each one has on the instance | An active Development, sandbox or On-Demand Sandbox connection. OCAPI is not needed. On Staging and Production the section reads Site scopes are not available for staging instances yet |
| Local project | Sites from site.xml files in the project, such as site import data, with their custom-cartridges path | A site.xml whose site has an ID and a name. Edits to the file are picked up automatically |
| Global | Global scope | Nothing. Every linked cartridge is used, in name order |
Site menu
Hover a site and click its ⋮ button, or press the Right arrow key
| Item | What it does |
|---|---|
| Show cartridge path | Opens the site's cartridge path as a list, see The cartridge path popup |
| Copy cartridge path | Copies the path, for example app_acme_us:int_adyen:plugin_wishlists:app_storefront_base, and confirms with Cartridge path copied |
| Open Business Manager | Remote sites only. Opens Business Manager of the active connection |
| Open site.xml | Local sites only. Opens the site.xml the site was read from |
Show cartridge path and Copy cartridge path are disabled for a site that has no cartridge path
The cartridge path popup
AcmeEU cartridge path lists the site's cartridges in order, each with its position and icon. A cartridge on the path that the project doesn't link is grey and tagged Not linked
- Type in Filter 24 cartridges to narrow the list, with the match highlighted
Enteror a double-click on a linked cartridge selects its folder in the Project view- The footer counts them,
21 linkedand3 not linked, and Copy path copies the whole path, then reads Copied
To change the cartridge path of a local site, click the Edit cartridge path lens above <custom-cartridges> in its site.xml, or the cartridge icon in the gutter, to open the Cartridge Path Editor
What the scope changes
| Area | With a site selected |
|---|---|
| JavaScript and Digital Script | require('*/...') and module.superModule resolve along the site's cartridge path, see Module Resolution |
| Routes and controllers | Go to Declaration and route lookups prefer the controller the site would run |
| Page Designer | Component scripts resolve along the site's path |
| Overrides | The Override grid numbers the cartridges in the site's order, and marks the ones off it |
| Files off the path | A banner names the sites that run the file's cartridge, see Which sites use a cartridge |
| Salesforce B2C Commerce project view | The root shows the site name, and cartridges follow its path. See Cartridges & Modules |
| Pipeline Editor | Opening a storefront route uses the selected site |
| Pipeline debugging | The debug session runs against the selected site |
Uploads and deploys don't depend on the scope: every linked cartridge is still uploaded
Which sites use a cartridge
A file in a linked cartridge that the selected site doesn't run gets a warning banner, for scripts and every other cartridge file:
This file is in a cartridge that is not on the cartridge path of the selected site AcmeUS; it is on the cartridge path of AcmeCA, AcmeEU and 2 more
| Action | Does |
|---|---|
| 4 sites use it | Opens Sites with app_acme_intl on their cartridge path. Hover a site for its card, click it to make it the site scope |
| Switch site | Opens B2C Site Scopes |
| Dismiss | Hides the banner in this editor until the status changes |
When no site runs the cartridge, the banner says it is on the cartridge path of no site. The banner needs a license. ISML templates have their own banner with the same links, see ISML navigation. The same sites show in the Override grid and in Overrides of
The cartridge chip
The editor's top-right corner names the file's cartridge, next to the inspection counter. Hover it for Cartridge of taxHelpers.js, or for the banner's text when the cartridge is off the path, then click it to select the cartridge folder in the Project view, or in the B2C project view when that one is open. It shows for files in linked cartridges and needs a license
Troubleshooting
| Symptom | What to do |
|---|---|
| Cannot load remote site scopes | Check the active connection with Test Connection in Connections, then open the popup again |
| "No remote site scopes were returned" | The instance returned no sites for this account. Use a local site.xml or Global scope |
| The Local project section is missing | The project has no site.xml with a site, or indexing is still running ("Wait for project indexing to finish") |
| A cartridge on the path is not used | The site's path names a cartridge that is not linked in the project. Link it in Cartridges & Modules |
| Site scopes are not available for staging instances yet | Remote sites load from Development, sandboxes and On-Demand Sandboxes. Pick a local site or Global scope |
| "Select a site scope before opening a storefront route." | Pick a site in the widget |
| The widget is missing from the status bar | Right-click the status bar and turn on B2C Site Scopes |