0

I have a situation where I need to add a custom script path after script paths appearing from assetlinks.Scripts in the Sxa Layout file. Tried using placeholder after for loop, but did not work out very well. Custom script is added as Html snippet in presentation details into website metadata partial design

    @Html.Sxa().RenderRaw("<div id=\"footer\" class=\"main clearfix\">")
    @Html.Sxa().RenderRaw("...")
    @Html.Sxa().RenderRaw("</div>")
    <div id="body-bottom" class="main clearfix">
        <div class="row">
            <div class="grid-12">
                @Html.Sitecore().Placeholder("body-bottom")
            </div>
        </div>
    </div>
    @Html.Sxa().RenderRaw("</body>")
    @Html.Sxa().RenderRaw("</html>")
</div>
@foreach (string script in assetLinks.Scripts)
{
    @Html.Raw(script)

}
@Html.Sitecore().Placeholder("custom-scripts")

This is the placeholder @Html.Sitecore().Placeholder("custom-scripts")

Can anyone suggest any alternatives?

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.