supernaut242
02/19/2024, 3:39 PM@await SmidgeHelper.CssHereAsync()
and in my Footer.cshtml
partial I have:
SmidgeHelper.RequiresCss("~/css/footer.css");
This does not inject the css in the master template as I expected. If I add the RequiresCss code in the master template itself it works, but not in the partial.
I'm new to Umbraco (and .net) and what I'm trying to achieve is to only import the used CSS files on each page, I have understood that this is the preferred method for this?Ambert
02/20/2024, 11:15 AMcsharp
SmidgeHelper.RequiresCss("~/css/main.min.css");
@await SmidgeHelper.CssHereAsync()
View contains
csharp
SmidgeHelper.RequiresCss("~/css/external/splide.min.css");
And my css for the slider works perfectly.. Could you double check paths ?Mike Chambers
02/20/2024, 5:43 PMMike Chambers
02/20/2024, 5:45 PMMike Chambers
02/20/2024, 5:46 PMAmbert
02/20/2024, 6:20 PMMike Chambers
02/21/2024, 10:37 AMIf you use child actions or view components, it breaks (generally speaking)
is mentioned by Shannon in issue 145?
@Ambert Perhaps you can share your particular magic?
At a client request we did implement something around HttpContext.Items
~
https://stackoverflow.com/questions/56918542/how-to-use-section-scripts-in-a-partial-view-mvc-core/72933590#72933590
with inspiration from @CodeSharePaul resource
https://codeshare.co.uk/blog/how-to-include-scripts-from-partial-views-in-mvc-and-umbraco/Ambert
02/21/2024, 10:40 AMMike Chambers
02/21/2024, 10:43 AMshazwazza.
02/22/2024, 12:36 AMA hub and casual space for you to interact with fellow community members and learn more about Umbraco!
Powered by