0

We have created a custom Accordion Module. Therefore, we also changed the Accordion MVC Layout.cshtml for Accordion Items. But our custom theme doesn't appear in the head nor does the js show up. What did we miss?

  • What did you do? (before we can answer what you might be missing, we need more info about what you have been doing) – Gatogordo Jun 15 at 11:34
  • I've duplicated the Accordion MVC Layout. On the Accordion Item on the Standard Values I've changed the Layout to my copied Layout. – Nadine Lendzian Jun 16 at 10:52
  • @NadineLendzian Did you modified the layout *.cshtml file? Can you show me it? – Dawid Rutkowski Jun 17 at 7:18
0

I don't see any additional pieces of information from your side (as it was suggested in the comments) so I will write what I think you might be missing.

You wrote that you have a custom AccordionMvcLayout.cshtml. If you will take a look inside of that file, you will notice that on the top there is something like:

@{
    Layout = Sitecore.Configuration.Settings.GetSetting("XA.Feature.Composites.CompositeComponentLayoutPath", "Composite Component Layout.cshtml");
    ViewBag.Title = "Edit accordion item";
}

This view is using its own layout which is most cases (if not changed) is Composite Component Layout.cshtml. Go there and you will find the following lines in that file:

@{
    AssetLinks assetLinks = AssetLinksGenerator.GenerateLinks(new CompositeThemesProvider());
}

...

@foreach (string style in assetLinks.Styles)
{
    @Html.Raw(style)
}

...

@{
    foreach (string script in assetLinks.Scripts)
    {
        @Html.Raw(script)
    }
    ...
}

This code is responsible for rendering CSS and JS link. So double check if you custom layout have Layout = Sitecore.Configuration.Settings.GetSetting("XA.Feature.Composites.CompositeComponentLayoutPath", "Composite Component Layout.cshtml"); just like the original one.

| improve this answer | |
  • I've checked my AccordionMvcLayout.cshtml and it does have the code you mentioned: @{ Layout = Sitecore.Configuration.Settings.GetSetting("XA.Feature.Composites.CompositeComponentLayoutPath", "Composite Component Layout.cshtml"); ViewBag.Title = "Edit accordion item"; } – Nadine Lendzian Jun 30 at 13:13

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.