body tag. Considering Kentico Xperience, I would add it to the main _Layout.cshtml file.
... <script src="/Content/script.js" async asp-append-version="true"></script> </body> </html>
On the live site, that works well. Regrettably, in the Page builder, the script file gets loaded before the widgets. So, the script is not applied to the markup that is generated by widgets. Moreover, the widgets load after the
I also asked Kentico support, whether there is a Kentico or a .NET way to achieve the goal. I was told there is nothing like it. So, I was looking for a solution on my own.
.ktc-widget-zone element. Once the element is available the script is added to the page. If a page does not contain widgets, the script is added after a certain amount of interval runs.
Add this in your main layout file (i.e. _Layout.cshtml):
Further readingall posts
- Xperience by Kentico
In this post I will provide you with code that will localize your 404 page in your Kentico Xperience website.
In this article, you'll learn what it takes to migrate your page data from Kentico CMS to Kentico Kontent using the Migration tool.
In this article, you'll learn what it takes to migrate UniGrid data from Kentico CMS to Kentico Kontent using the Migration tool.