Exemplo n.º 1
0
 private void EnsureOrchardHelper()
 {
     if (_orchardHelper == null)
     {
         EnsureDisplayHelper();
         _orchardHelper = new OrchardRazorHelper(Context, _displayHelper);
     }
 }
Exemplo n.º 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));
        }
Exemplo n.º 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));
 }
Exemplo n.º 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));
        }