Пример #1
0
 private void EnsureOrchardHelper()
 {
     if (_orchardHelper == null)
     {
         EnsureDisplayHelper();
         _orchardHelper = new OrchardRazorHelper(Context, _displayHelper);
     }
 }
Пример #2
0
        public static string AssetUrl(this OrchardRazorHelper razorHelper, string assetPath)
        {
            var mediaFileStore = razorHelper.HttpContext.RequestServices.GetService <IMediaFileStore>();

            if (mediaFileStore == null)
            {
                return(assetPath);
            }

            return(mediaFileStore.MapPathToPublicUrl(assetPath));
        }
Пример #3
0
 public static string ImageResizeUrl(this OrchardRazorHelper razorHelper, string imagePath, int?width = null, int?height = null, ResizeMode resizeMode = ResizeMode.Undefined)
 {
     return(ImageSharpUrlFormatter.GetImageResizeUrl(imagePath, width, height, resizeMode));
 }
Пример #4
0
        public static string AssetUrl(this OrchardRazorHelper razorHelper, string assetPath, int?width = null, int?height = null, ResizeMode resizeMode = ResizeMode.Undefined)
        {
            var resolvedAssetPath = razorHelper.AssetUrl(assetPath);

            return(razorHelper.ImageResizeUrl(resolvedAssetPath, width, height, resizeMode));
        }