Example #1
0
        public ShopifyLiquidThemeEngine(IMemoryCache memoryCache, IWorkContextAccessor workContextAccessor,
                                        IHttpContextAccessor httpContextAccessor,
                                        IStorefrontUrlBuilder storeFrontUrlBuilder, IContentBlobProvider contentBlobProvder, IOptions <LiquidThemeEngineOptions> options)
        {
            _workContextAccessor  = workContextAccessor;
            _httpContextAccessor  = httpContextAccessor;
            _storeFrontUrlBuilder = storeFrontUrlBuilder;
            _options           = options.Value;
            _memoryCache       = memoryCache;
            _themeBlobProvider = contentBlobProvder;

            Liquid.UseRubyDateFormat = true;
            // Register custom tags (Only need to do this once)
            Template.RegisterFilter(typeof(CommonFilters));
            Template.RegisterFilter(typeof(CommerceFilters));
            Template.RegisterFilter(typeof(TranslationFilter));
            Template.RegisterFilter(typeof(UrlFilters));
            Template.RegisterFilter(typeof(DateFilters));
            Template.RegisterFilter(typeof(MoneyFilters));
            Template.RegisterFilter(typeof(HtmlFilters));
            Template.RegisterFilter(typeof(StringFilters));
            Template.RegisterFilter(typeof(ArrayFilters));
            Template.RegisterFilter(typeof(MathFilters));

            Condition.Operators["contains"] = CommonOperators.ContainsMethod;

            Template.RegisterTag <AntiforgeryTag>("anti_forgery");
            Template.RegisterTag <LayoutTag>("layout");
            Template.RegisterTag <FormTag>("form");
            Template.RegisterTag <PaginateTag>("paginate");
        }
Example #2
0
 public ShopifyLiquidThemeEngine(IMemoryCache memoryCache, IWorkContextAccessor workContextAccessor,
                                 IHttpContextAccessor httpContextAccessor,
                                 IStorefrontUrlBuilder storeFrontUrlBuilder, IContentBlobProvider contentBlobProvder, IOptions <LiquidThemeEngineOptions> options)
 {
     _workContextAccessor  = workContextAccessor;
     _httpContextAccessor  = httpContextAccessor;
     _storeFrontUrlBuilder = storeFrontUrlBuilder;
     _options           = options.Value;
     _memoryCache       = memoryCache;
     _themeBlobProvider = contentBlobProvder;
 }
Example #3
0
 public ShopifyLiquidThemeEngine(IStorefrontMemoryCache memoryCache, IWorkContextAccessor workContextAccessor, IHttpContextAccessor httpContextAccessor,
                                 IStorefrontUrlBuilder storeFrontUrlBuilder, IContentBlobProvider contentBlobProvider, ISassFileManager sassFileManager, IOptions <LiquidThemeEngineOptions> options, IFeaturesAgent featuresAgent)
 {
     _workContextAccessor     = workContextAccessor;
     _httpContextAccessor     = httpContextAccessor;
     UrlBuilder               = storeFrontUrlBuilder;
     _options                 = options.Value;
     _memoryCache             = memoryCache;
     _themeBlobProvider       = contentBlobProvider;
     _sassFileManager         = sassFileManager;
     _featuresAgent           = featuresAgent;
     SassCompiler.FileManager = sassFileManager;
 }