Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forced provider not rendering #120

Open
Lachlann opened this issue Jul 12, 2017 · 3 comments
Open

Forced provider not rendering #120

Lachlann opened this issue Jul 12, 2017 · 3 comments

Comments

@Lachlann
Copy link

Hello I have CD v1.9.2 , Cd -MVC 1.8.0 and CD- MVC5 1.8.0 installed and running on an Umbraco 7.5.4 site.

I am trying to use a forced provider to allow me to split up my CSS to render in two different locations.

I have edited my config like so:

  <mvc defaultRenderer="StandardRenderer">
    <renderers>
      <add name="StandardRenderer" type="ClientDependency.Core.FileRegistration.Providers.StandardRenderer, ClientDependency.Core" />
      <add name="Ie9Renderer" type="ClientDependency.Core.FileRegistration.Providers.StandardRenderer, ClientDependency.Core" />
      <add name="LazyLoadRenderer" type="ClientDependency.Core.FileRegistration.Providers.LazyLoadRenderer, ClientDependency.Core" />
    </renderers>
  </mvc>

and have referenced my css in the layout view as follows:

Html.RequiresCss(new CssFile("/ie/css/ie8.css") {ForceProvider= "Ie9Renderer" });

and then am calling it like:

  @Html.Raw(Html.RenderCssHere("Ie9Renderer"))

But nothing renders. The main referenced files still reference correctly.

@kipusoep
Copy link

kipusoep commented Jul 3, 2018

Same issue for me, no comments yet since a year? 😮

@Shazwazza
Copy link
Owner

Can you replicate this with a very simple setup? Perhaps you have cached views? What version?

@kipusoep please describe your own issue, is it exactly the same as above?

I used this just the other day and it was working so need to know specifics on how to replicate.

Also note that @Html.Raw to use RenderCssHere isn't necessary

@kipusoep
Copy link

kipusoep commented Jul 4, 2018

I ran into this issue with a project we inherited from another company. It was an umbraco v7.3.5 solution and I upgraded it to v7.11.1 via v7.5.14, v7.7.13 and v7.9.6.
Therefore CD is upgraded from v1.8.4 to v1.9.6. I don't have CD-Mvc installed, only ClientDependency-Mvc5 v1.8.0.

There is a head and foot view which contained these snippets:

@{
    Html.RequiresJs(new JavascriptFile("~/static/js/vendor/angular.js") {ForceProvider = "HeadRenderer" });
    Html.RequiresJs(new JavascriptFile("~/static/js/vendor/angular-sanitize.js") {ForceProvider = "HeadRenderer" });
    Html.RequiresJs(new JavascriptFile("~/static/js/vendor/angular-locale_nl-nl.js") {ForceProvider = "HeadRenderer" });
    Html.RequiresJs(new JavascriptFile("~/static/js/vendor/iframeresizer.min.js") {ForceProvider = "HeadRenderer" });
}
@Html.Raw(Html.RenderJsHere("HeadRenderer"))
@{

    Html.RequiresJs(new JavascriptFile("~/static/js/vendor/promise.js") { ForceProvider = "FootRenderer" });
    Html.RequiresJs(new JavascriptFile("~/static/js/vendor/jquery.min.js") { ForceProvider = "FootRenderer" });
    Html.RequiresJs(new JavascriptFile("~/static/js/vendor/ui-bootstrap-tpls-1.2.1.min.js") { ForceProvider = "FootRenderer" });
    Html.RequiresJs(new JavascriptFile("~/static/js/vendor/lodash.min.js") { ForceProvider = "FootRenderer" });
    Html.RequiresJs(new JavascriptFile("~/static/js/vendor/TweenMax.min.js") { ForceProvider = "FootRenderer" });
    Html.RequiresJs(new JavascriptFile("~/static/js/vendor/jquery.scrollTo.js") { ForceProvider = "FootRenderer" });
    Html.RequiresJs(new JavascriptFile("~/static/js/vendor/bootstrap.min.js") { ForceProvider = "FootRenderer" });
    Html.RequiresJs(new JavascriptFile("~/static/js/vendor/angular-tooltips.js") { ForceProvider = "FootRenderer" });
    Html.RequiresJs(new JavascriptFile("~/static/js/vendor/ng-password-strength.js") { ForceProvider = "FootRenderer" });
    Html.RequiresJs(new JavascriptFile("~/static/js/vendor/moment.js") { ForceProvider = "FootRenderer" });
    Html.RequiresJs(new JavascriptFile("~/static/js/vendor/pikaday.js") { ForceProvider = "FootRenderer" });
    Html.RequiresJs(new JavascriptFile("~/static/js/vendor/pikaday.jquery.js") { ForceProvider = "FootRenderer" });
    Html.RequiresJs(new JavascriptFile("~/static/js/main.js") { ForceProvider = "FootRenderer" });
}

@Html.Raw(Html.RenderJsHere("FootRenderer"))

This was working fine before the upgrades, after the upgrades nothing got rendered anymore.
In the meantime I went with the Bundler stuff from Bundler & Minifier for VS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants