Ejemplo n.º 1
0
        public void Configure(IApplicationBuilder app, ISitecorePluginManager pluginManager, ISitecoreHostingEnvironment hostingEnvironment)
        {
            var plugin = pluginManager.Resolve(this);

            _logger.LogInformation($"The SettingOne value is: { _configuration.GetSection("Sitecore:Hostbase.Plugin:SettingOne").Value }");
            _logger.LogInformation($"Plugin is running, name is: { plugin.PluginName }");
            _logger.LogInformation($"Application name is: { hostingEnvironment.ApplicationName }");
        }
        public void Configure(IApplicationBuilder app, ISitecorePluginManager pluginManager, ISitecoreHostingEnvironment hostingEnvironment)
        {
            var plugin = pluginManager.Resolve(this);

            app.UseStaticFiles(new StaticFileOptions
            {
                FileProvider = new PhysicalFileProvider(Path.Combine(Path.Combine(Directory.GetCurrentDirectory(), plugin.Path), "Content")),
                RequestPath  = $"/{ plugin.PluginName }"
            });
        }
Ejemplo n.º 3
0
        public void Configure(IApplicationBuilder app, ISitecorePluginManager pluginManager, ISitecoreHostingEnvironment hostingEnvironment)
        {
            var plugin = pluginManager.Resolve(this);

            app.UseStaticFiles(new StaticFileOptions
            {
                FileProvider = new PhysicalFileProvider(Path.Combine(plugin.Path, "Content")),
                RequestPath  = $"/{ plugin.PluginName }"
            });
            app.UseMvc((Action <IRouteBuilder>)(routes => routes.MapRoute("default", "{controller=Home}/{action=Index}/{id?}")));
        }
Ejemplo n.º 4
0
        public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
        {
            if (_alertService.IsEnabled)
            {
                var plugin = _pluginManager.Resolve(this);
                if (string.Equals(context.TagName, "head", StringComparison.OrdinalIgnoreCase))
                {
                    string styles = $"<link rel=\"stylesheet\" href=\"/{ plugin.PluginName }/css/alert.css\">";
                    output.PostContent.AppendHtmlLine(styles);
                }

                if (string.Equals(context.TagName, "body", StringComparison.OrdinalIgnoreCase))
                {
                    string script = $"<script src=\"/{ plugin.PluginName }/js/alert.js\" data-message=\"{ _alertService.Message }\"></script>";
                    output.PostContent.AppendHtmlLine(script);
                }
            }
            return(Task.CompletedTask);
        }