I created a new layout and page template and would like it to work with SXA in Experience Editor. I needed to add the following to get it to render any components with rendering variants:

      <template name="Modal">{881F54C1-D532-458D-9376-A7AD21851AAB}</template>
      <template name="Modal">{881F54C1-D532-458D-9376-A7AD21851AAB}</template>

However two last issues, one is when adding a Container component I get this error:

Exception: System.ArgumentNullException
Message: Value cannot be null.
Parameter name: url
Source: Sitecore.Kernel
   at Sitecore.Diagnostics.Assert.ArgumentNotNull(Object argument, String argumentName)
   at Sitecore.Text.UrlString..ctor(String url)
   at Sitecore.XA.Foundation.Grid.Pipelines.ExecutePageEditorAction.FillGridDefaultValues.GetTargetParameters(IInsertRenderingArgs args)
   at Sitecore.XA.Foundation.Grid.Pipelines.ExecutePageEditorAction.FillGridDefaultValues.Process(PipelineArgs args)
   at (Object , Object )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
   at Sitecore.Pipelines.ExecutePageEditorAction.ExecutePageEditorActionPipeline.Run(ExecutePageEditorActionArgs args)
   at Sitecore.Shell.Applications.WebEdit.Palette.OnPreInit(EventArgs e)
   at System.Web.UI.Page.PerformPreInit()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

The other issue is that the SXA toolbox doesn't show.


I'm on SXA 10.0

Thanks to pete I have added this config too

      <layout id="{D6234A91-C8BD-45FC-8184-6B573AE1D651}">
        <placeholder name="head"/>
        <placeholder name="body-bottom"/>
        <placeholder name="body-top"/>

Here's my layout:

@model Sitecore.Mvc.Presentation.RenderingModel
    AssetLinks assetLinks = null;
<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="@Model.Item.Language.Name">
    @if (Html.Sxa().IsEdit)
        assetLinks = AssetLinksGenerator.GenerateLinks(new ThemesProvider());
        foreach (string style in assetLinks.Styles)
    <meta name="robots" content="noindex">
<body @Html.Sxa().Body().Decorate()>
    @if (Html.Sxa().IsEdit)
        foreach (string script in assetLinks.Scripts)

Thanks to Miguel Minoldo to get the toolbox working, but still getting the same error, only on the "main" placeholder, and only on the container. I am not adding a new Device, and the grid mapping in the Settings item is correct.

My main goal here is to have a layout that doesn't render any scripts or styles when not in edit mode.


SXA has some code that will copy the grid rendering parameters from the previous rendering on the placeholder that you are trying to add the component to.

In this case I had a rendering on the "main" placeholder that does not have any grid rendering parameters field.

This code is in Sitecore.XA.Foundation.Grid.Pipelines.ExecutePageEditorAction.FillGridDefaultValues

protected virtual string GetTargetParameters(IInsertRenderingArgs args)
List<RenderingDefinition> placeholderRenderings = this.GetPlaceholderRenderings(args.Device, args.PlaceholderKey);
return placeholderRenderings.Count > 0 && args.Position < placeholderRenderings.Count ? new UrlString(placeholderRenderings.ElementAt<RenderingDefinition>(args.Position).Parameters).Parameters["GridParameters"] : string.Empty;

We can see here that it is doing a null check for whether the previous rendering has "GridParameters", but then it is not possible to create a new UrlString() with an empty string.

The workaround here is to not add any renderings to the placeholder that don't have have a grid rendering parameters field.

I have reported to Sitecore Support and it has been registered as a Wish with Reference Number 470566.


Check that you have a valid grid mapping selected:

Grid Mapping Settings

Also, for the missing SXA toolbox, make sure you have the <div id="wrapper"> in your layout.

I hope it helps you!

  • Thanks, you helped get the toolbox working, but the grid mapping is already correct – Mark Gibbons Mar 30 at 23:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.