I have been working with ClientDependency to group together my CSS and js requests into fewer requests and was wondering how to do this with a master and child template. For example, if I have a master template that contains 2 global css files and 2 global js files and then a child template that has 2 css and 2 js files, how can I group these into 1 css and 1 js client dependency request while keeping the global files at the master level and the page files at the child level?
I tried adding the <CD:CssInclude tag to both the master and child and only call the loader in one of the files (tried each master and child separately) but this didn't work.
Can this be done? If so, how do you do it?
Also, do you need to add a property to the CssInclude tag to enable compression / minification or is this automatic?
OK. I figured this out. For anyone who is interested, add the
<CD:CssInclude tags in the master page in the head, and add the <CD:CssInclude tags in the child page into the head contentplaceholder and then call the Loader from the child page. This works (I just had a bad reference in the child page previously which is why it didn't appear to work).
ClientDependency master child template question
I have been working with ClientDependency to group together my CSS and js requests into fewer requests and was wondering how to do this with a master and child template.
For example, if I have a master template that contains 2 global css files and 2 global js files and then a child template that has 2 css and 2 js files, how can I group these into 1 css and 1 js client dependency request while keeping the global files at the master level and the page files at the child level?
I tried adding the <CD:CssInclude tag to both the master and child and only call the loader in one of the files (tried each master and child separately) but this didn't work.
Can this be done? If so, how do you do it?
Also, do you need to add a property to the CssInclude tag to enable compression / minification or is this automatic?
Thanks!
Zac
Nevermind about the compression / minification, this is working fine.
OK. I figured this out. For anyone who is interested, add the
<CD:CssInclude tags in the master page in the head, and add the <CD:CssInclude tags in the child page into the head contentplaceholder and then call the Loader from the child page. This works (I just had a bad reference in the child page previously which is why it didn't appear to work).
Hope this helps someone else!
is working on a reply...