You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

To improve the load time of customer self service web pages you can use the application to minimise the style sheet (CSS) and JavaScript files at run time.

This uses Razor technology.

Step-by-step guide

To bundle and minify JavaScript files:

  1. Login as an administrator
  2. Go to the "Template Editor" page
  3. Open up the "Code Editor"
  4. Include web optimisation into the razor template
  5. Create a new "Script Bundle"
  6. Include your scripts into the bundle
  7. Create and load your bundle

 

@using System.Web.Optimization;
@{
  var cvScripts = new ScriptBundle("~/TemplateBundles/CVScripts");
}
... Other HTML here
@{
  cvScripts.Include("~/Scripts/cv.util.js");
}
... Other HTML here
@ {
  BundleTable.Bundles.Add(cvScripts);
	@Raw(@Model.TemplateUtil.ScriptRender("~/TemplateBundles/CVScripts"))
}

 

 

 

To enable this functionality the template needs to be a version 4 (Razor) template

 

Error rendering macro 'contentbylabel'

parameters should not be empty

 

  • No labels