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. With a site selected, completion, Go to Declaration, the Salesforce B2C Commerce project view and the pipeline tools follow that site's cartridge order, the same way the server does

The B2C Site Scopes widget lists the sites of the selected instance and of the local site.xml files. Each site's submenu shows or copies its cartridge path and opens Business Manager or site.xml, and picking a site orders code insight by that path

Pick a site

Open B2C Site Scopes

Click the site scope widget in the status bar at the bottom of the IDE. It reads Global scope, or the selected site with the number of cartridges on its path, for example "RefArch (3)"

Look at the sites

The B2C Site Scopes popup lists the sites from your active instance and from your project, see the sections below. Hover a site to see its ID and cartridge path

Select one

Click a site. The widget switches to it, open files are re-analyzed and navigation now follows its cartridge path. Choose Global scope to go back to every linked cartridge

Where the sites come from

SectionListsNeeds
Remote instance: Dev 01The sites of the active connection, with the cartridge path each one has on the instanceAn active connection. The plugin asks the instance with the connection's account, OCAPI is not needed
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

While the lists load you see "Loading B2C site scopes" or "Loading local project site scopes". How it works at the bottom opens an article about the feature

Hover a site and open its submenu

ItemWhat it does
Show cartridge pathShows the site's cartridges in order, titled for example "RefArch cartridge path (3)"
Copy cartridge pathCopies the path, for example app_custom:int_paypal: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

To change the cartridge path of a local site, open its site.xml and click the gutter icon on <custom-cartridges>. The Cartridge Path Editor edits the path as a list, and the Local project section picks up the new order

What the scope changes

AreaWith a site selected
JavaScript and DemandwareScriptrequire('*/...') 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 cartridge list in the override dialog follows the site's order
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. The scope only changes the order and which site the IDE follows

Troubleshooting

SymptomWhat to do
Cannot load remote site scopesThe plugin couldn't read the sites from the active connection. Check the 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" means the IDE is still indexing
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
"Select a site scope before opening a storefront route."The pipeline editor opens storefront routes on the selected site. Pick one in the widget
The widget is missing from the status barRight-click the status bar and turn on B2C Site Scopes

On this page