Skip to Content

Site Scopes

Choose a storefront site in the status bar so code insight, navigation and the pipeline tools follow that site's cartridge path

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

B2C Site Scopes lists the sites of the active instance and of the local site.xml files. Hover a site for its cartridge path in columns, pick it to order code insight by that path, or open the path from the site's ⋮ button to filter it, copy it and reveal a cartridge

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

SectionListsNeeds
Remote instance: Sandbox 01The sites of the active connection, with the cartridge path each one has on the instanceAn 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 projectSites from site.xml files in the project, such as site import data, with their custom-cartridges pathA site.xml whose site has an ID and a name. Edits to the file are picked up automatically
GlobalGlobal scopeNothing. Every linked cartridge is used, in name order

Hover a site and click its ⋮ button, or press the Right arrow key

ItemWhat it does
Show cartridge pathOpens the site's cartridge path as a list, see The cartridge path popup
Copy cartridge pathCopies the path, for example app_acme_us:int_adyen:plugin_wishlists:app_storefront_base, and confirms with Cartridge path copied
Open Business ManagerRemote sites only. Opens Business Manager of the active connection
Open site.xmlLocal 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

B2C Site Scopes lists the sites of the active instance and of the local site.xml files. Hover a site for its cartridge path in columns, pick it to order code insight by that path, or open the path from the site's ⋮ button to filter it, copy it and reveal a cartridge
  • Type in Filter 24 cartridges to narrow the list, with the match highlighted
  • Enter or a double-click on a linked cartridge selects its folder in the Project view
  • The footer counts them, 21 linked and 3 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

AreaWith a site selected
JavaScript and Digital Scriptrequire('*/...') and module.superModule resolve along the site's cartridge path, see Module Resolution
Routes and controllersGo to Declaration and route lookups prefer the controller the site would run
Page DesignerComponent scripts resolve along the site's path
OverridesThe Override grid numbers the cartridges in the site's order, and marks the ones off it
Files off the pathA banner names the sites that run the file's cartridge, see Which sites use a cartridge
Salesforce B2C Commerce project viewThe root shows the site name, and cartridges follow its path. See Cartridges & Modules
Pipeline EditorOpening a storefront route uses the selected site
Pipeline debuggingThe 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 cartridge the selected site doesn't run gets a banner that names the sites that do. Pick one of them to switch the site scope. The chip next to the inspection counter names the file's cartridge and shows it in the Project view

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

ActionDoes
4 sites use itOpens Sites with app_acme_intl on their cartridge path. Hover a site for its card, click it to make it the site scope
Switch siteOpens B2C Site Scopes
DismissHides 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

SymptomWhat to do
Cannot load remote site scopesCheck 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 missingThe 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 usedThe 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 yetRemote 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 barRight-click the status bar and turn on B2C Site Scopes

On this page