Mavention Bundles

  0 rating
9/4/2015 1:48:16 PM
9/7/2015 2:02:01 PM
Provider: Mavention

About

Mavention Bundles is a Sitecore module that allows you to register bundles using the Sitecore patching facilities. The module registers a custom pipeline component that during the initialization of your Sitecore website scans the configuration files for bundles definitions and registers them with the ASP.NET MVC runtime.

Documentation

Documentation
Back
Release notes

Read more Back
Code examples
  • <br>

    0
  • <br>
    After installing the module the only thing left for you to do, is to create an include file with the bundles definition for your website. Following is a sample include file based on the LaunchSitecore website:

    <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
      <sitecore>
        <maventionBundles>
          <enableOptimizations>true</enableOptimizations>
          <bundles hint="list">
            <bundle hint="1" type="Mavention.Sitecore.Bundles.SiteBundle, Mavention.Sitecore.Bundles">
              <bundlePath>~/bundles/js</bundlePath>
              <bundleType>Script</bundleType>
              <files hint="list">
                <file hint="1">~/assets/js/bootstrap.min.js</file>
                <file hint="2">~/assets/js/custom.js</file>
              </files>
            </bundle>
            <bundle hint="2" type="Mavention.Sitecore.Bundles.SiteBundle, Mavention.Sitecore.Bundles">
              <bundlePath>~/bundles/css</bundlePath>
              <bundleType>Style</bundleType>
              <files hint="list">
                <file hint="1">~/assets/css/bootstrap.css</file>
                <file hint="2">~/assets/css/font-awesome.css</file>
                <file hint="3">~/assets/css/font-awesome-ie7.css</file>
                <file hint="4">~/assets/css/custom_base.css</file>
                <file hint="5">~/assets/css/custom_nav.css</file>
                <file hint="6">~/assets/css/custom_modules.css</file>
                <file hint="7">~/assets/css/custom_mvc.css</file>
              </files>
            </bundle>
          </bundles>
        </maventionBundles>
      </sitecore>
    </configuration>

    Then in your layouts you would simplify refer to these bundles:

    <link href="/bundles/css" rel="stylesheet">
    <script src="/bundles/js"></script>
    0
  • Code examples > Sample include file defining bundles
    Sample include file defining bundles
    <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
      <sitecore>
        <maventionBundles>
          <enableOptimizations>true</enableOptimizations>
          <bundles hint="list">
            <bundle hint="1" type="Mavention.Sitecore.Bundles.SiteBundle, Mavention.Sitecore.Bundles">
              <bundlePath>~/bundles/js</bundlePath>
              <bundleType>Script</bundleType>
              <files hint="list">
                <file hint="1">~/assets/js/bootstrap.min.js</file>
                <file hint="2">~/assets/js/custom.js</file>
              </files>
            </bundle>
            <bundle hint="2" type="Mavention.Sitecore.Bundles.SiteBundle, Mavention.Sitecore.Bundles">
              <bundlePath>~/bundles/css</bundlePath>
              <bundleType>Style</bundleType>
              <files hint="list">
                <file hint="1">~/assets/css/bootstrap.css</file>
                <file hint="2">~/assets/css/font-awesome.css</file>
                <file hint="3">~/assets/css/font-awesome-ie7.css</file>
                <file hint="4">~/assets/css/custom_base.css</file>
                <file hint="5">~/assets/css/custom_nav.css</file>
                <file hint="6">~/assets/css/custom_modules.css</file>
                <file hint="7">~/assets/css/custom_mvc.css</file>
              </files>
            </bundle>
          </bundles>
        </maventionBundles>
      </sitecore>
    </configuration>
    0

Solution screenshots(0)

Upload

Reviews (0)

Sort by: Date Most votes
  • Profile Avatar
    [fullName]

    Level: 0

    x0 x0 x0

    [date]

    [title]

    [text]

    Was this helpful?

    0

Comments (0)

Sort by: Date  Most votes

Leave a Comment

Comment must be field in
Post comment
loader

Write a review

Title can't be empty
Review can't be empty
Post review

Download

Title Description Download Action

Add File