j
Using Umbraco 12 is Smidge the best tool to use for referencing JS and CSS files or is there a better way to do this? We have a lot of Templates that use different style sheets. And we also have a lot of Grid blocks - which use their own JS files - so we need a way to prevent multiple duplication JS references being called on the site. Can you give any ideas? Thanks
m
Depends what your requirements are.. Smidge is a bundle/compress engine and best practise is to pre bundle your files. If you want dynamic bundles that's only supported from views (so not partials/view components)
to replace that we used the inject into the
HttpContext.Items[]
approach
j
Thanks for this. Is there a simple way to replicate the old Cassette way - so for example - a YouTube Grid block would use a Cassette AddInLineScript where we can give it a unique ID eg: Cassette.Views.Bundles.AddInlineScript( @ $(document).ready(function () { var video = $("#videoModal-@g .m-video__video"); var $videoSrc = ""; var $youTubeId = '@content__YouTubeId';........ etc etc Is there a neat way of doing this in Umbraco 12? Thanks
m
7 Views