Adjust link settings to enable cross-site linking
The Link rendering lets content authors add links to sites. Links can be internal links, media links, external link, anchors, mail, and JavaScript. To link within SXA site collections and sites, you must adjust the site settings.
To enable cross-site linking:
-
Set the link root location by navigating to sitecore/Content/<site collection>/<site>/Settings.
-
In the Site Configuration section, in the Link Settings field, select one of the following options:
Link Settings field option
Link root location
Itself only
Default value. The available link root location comes from the current site.
Linkable sites in site collection
All linkable sites within the current site collection.
All linkable
All linkable site within all site collections.
-
To make a site linkable, navigate to sitecore/Content/<site collection>/<site>/Settings/Site Grouping/Site, and in the Basic section, select the Linkable Site check box.
For example, if you have five sites divided over two site collections:
Site 5 is set to be able to link across site collections.
All sites except site 2 are set to be linkable.
If you add the link component in the Experience Editor, and click Edit Link, in the Insert a link dialog box, you can link to all sites except for site 2.
Another example: Site 2 is set to not be linkable, and the Link Settings field is set to enable linking to sites within the same site collection:
If you now insert a link in the Content Editor, you can only link to site 1 and site 3 within the same site collection.
To make non-SXA sites linkable, you must add the from SXA add the property sxaLinkable="true"
in the configuration node of the site. For example:
<site name="website" enableTracking="true" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content" startItem="/home" language="en" database="web" domain="extranet" allowDebug="true" cacheHtml="true" htmlCacheSize="50MB" registryCacheSize="0" viewStateCacheSize="0" xslCacheSize="25MB" filteredItemsCacheSize="10MB" enablePreview="true" enableWebEdit="true" enableDebugger="true" disableClientData="false" cacheRenderingParameters="true" renderingParametersCacheSize="10MB" enableItemLanguageFallback="false" enableFieldLanguageFallback="false" role:require="Standalone or Reporting or ContentManagement or ContentDelivery" sxaLinkable="true" />