I feel dumb asking this but I've installed Optimus (1.4 with U7.4) and everything seems to be working fine/great, and I'm excited! I created a couple of bundles but I can't figure out how to add them into the template.
In the template edit UI, if I click on "Create script/style bundle", the right side bar comes up and says, "Please select at least 1 script or stylesheet on your template before creating a bundle." But the rest of that area is empty -- there is no list, even though my bundles exist under Bundling > Styles.
I am happy to add it manually but I also can't find where the files are stored.
Context Must Implement System.Web.WebPages.WebPage.
So I am a bit lost. I am sure my syntax is just wrong -- I am at best a a Razor "aficionado" ;). My umbracoSettings.config is set to <defaultRenderingEngine>Webforms</defaultRenderingEngine> for other reasons, which is why I need it to be in a cshtml macro. Will this work?
Me too -- and as I said, very exciting package. I had been doing this outside of Umbraco with four separate U instances so this is pretty damned slick. GREAT WORK!
Now to try out SASS so "Let's go to the videotape!"
Stumbling a bit with the SASS provider, though. My bundle isn't including three .scss files which are in my main.scss imports, though, throwing errors about a variable not being defined -- but it is defined.
The moment the compiler gets to this line in _home.scss, I get this error:
During translation of SCSS-code, readed from the file '/css/_home.scss', to CSS-code syntax error has occurred. See more details: Message: Undefined variable: "$medium-up". File: /css/_home.scss Line number: 201
That line is:
@media #{$medium-up} {
But that var is defined in _mediaqueries.scss, which is prior to _home.scss:
$medium-up: "#{$screen} and (min-width:#{lower-bound($medium-range)})" !default;
And _mixins.scss, which is imported prior to _home.scss, uses variables defined here as well and compiles okay (I think; there are no errors saving that one).
I get the same error on _cat and _dog. Seems like I'm doing everything right here. CSS file main.css is generated and minified and served in my bundle, but I can't seem to get past these errors to complete this.
Ideas? I'd really appreciate any further counsel on the SASS provider.
Optimus: How to Add to Template?
Hi,
I feel dumb asking this but I've installed Optimus (1.4 with U7.4) and everything seems to be working fine/great, and I'm excited! I created a couple of bundles but I can't figure out how to add them into the template.
In the template edit UI, if I click on "Create script/style bundle", the right side bar comes up and says, "Please select at least 1 script or stylesheet on your template before creating a bundle." But the rest of that area is empty -- there is no list, even though my bundles exist under Bundling > Styles.
I am happy to add it manually but I also can't find where the files are stored.
Ideas?
Thanks,
Garrett
Comment author was deleted
Hi Garret,
You'll need to add the following snippet:
@Scripts.Render("~/bundles/yourBundle)
or
@Styles.Render("~/bundles/yourBundle") (if it's a styles bundle)
Comment author was deleted
The UI tool is used in the following way as shown in the video http://www.nibble.be/?p=238
Thanks so much for your attention, Tim!
The video is EXCELLENT! Very helpful to understand the workflow.
However....
With only:
I get the following error:
So then I try these using/inherits lines with it:
And get this error:
So I am a bit lost. I am sure my syntax is just wrong -- I am at best a a Razor "aficionado" ;). My umbracoSettings.config is set to
<defaultRenderingEngine>Webforms</defaultRenderingEngine>
for other reasons, which is why I need it to be in a cshtml macro. Will this work?Thank you again,
Garrett
Comment author was deleted
Ah ok you are still running webforms, there should be an equivalent to @Styles.Render, let me check
Comment author was deleted
COuld you try http://stackoverflow.com/questions/30508805/adding-bundles-to-existing-asp-net-webforms-solution
Comment author was deleted
So in web.config add
and then
Ok, thanks! Thing is, I am actually running other Razor code in this same template, a la:
So I would thing it would work.... Let me know what you find! And thanks sincerely for your very timely assistance.
//Garrett
Comment author was deleted
ok, don't think you need the @inherits Umbraco.Web.Mvc.UmbracoTemplatePage in your inline razor so should just be
@using System.Web.Optimization
@Styles.Render("~/bundles/TestBundle")
Thanks, I already had the web.config entry from the install script. This syntax change made the error(s) go away, and it writes to the page:
But there is no /bundles folder so of course this results in a 404. What do I need to do to get the virtual paths working?
//Garrett
Comment author was deleted
How did you call your bundle? Is there an entry in the reservedpaths app setting (that makes sure umbraco ignores the bundles path)?
Yes, there is an entry in reservedpaths. Not sure why the querystring is not appended using the classic ASP.NET tags.
//Garrett
Comment author was deleted
Must say it's been a while since I looked at the package so not that fresh in my mind anymore, but will spin up the test site
Comment author was deleted
So the app setting should loook like , then the umbraco 404 won't kick in
Comment author was deleted
oops html got eaten
should look like
THIS IS OVER :)
Is the magic code!
This results in the following output:
I earnestly appreciate your help, Tim. CHEERS!
//Garrett
Comment author was deleted
Woohoo, glad you have it working!
Me too -- and as I said, very exciting package. I had been doing this outside of Umbraco with four separate U instances so this is pretty damned slick. GREAT WORK!
Now to try out SASS so "Let's go to the videotape!"
A million thanks, Garrett
Comment author was deleted
Glad you like it :)
It's amazing.
Stumbling a bit with the SASS provider, though. My bundle isn't including three .scss files which are in my main.scss imports, though, throwing errors about a variable not being defined -- but it is defined.
main.css:
The moment the compiler gets to this line in _home.scss, I get this error:
That line is:
But that var is defined in _mediaqueries.scss, which is prior to _home.scss:
And _mixins.scss, which is imported prior to _home.scss, uses variables defined here as well and compiles okay (I think; there are no errors saving that one).
I get the same error on _cat and _dog. Seems like I'm doing everything right here. CSS file main.css is generated and minified and served in my bundle, but I can't seem to get past these errors to complete this.
Ideas? I'd really appreciate any further counsel on the SASS provider.
Thanks again,
Garrett
is working on a reply...