upgrade custom theme from 2.4 to 2.5 (AppendCssFileParts)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Summary
Upgraded a custome theme from 2.4 to 2.5 and am now recieving an error in regards to 'AppendCssFileParts'.
This is with the no source code version.

Error Message in system logs
e:\web\website\Themes\customtheme\Views\Shared\Head.cshtml(3): error CS1061: 'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'AppendCssFileParts' and no extension method 'AppendCssFileParts' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive or an assembly reference?)

How theme was updated.
Copied the old theme into the themes folder.
Compared each of the views with the default 2.5 views and updated any code/style changes.
Replaced the custom theme style sheet with the nopClassic (will work on this part later of course).



The problem seems to be the /views/shared/head.cshtml, in Visual Studio 2010 it has "AppendCssFileParts" underlined and give an error simular to what the system log shows. The only difference between the nopClassic Head.cshtml and the customtheme Head.cshtml is the content pointer.

@using Nop.Web.Framework;
@{
    Html.AppendCssFileParts(Url.Content("~/Themes/customtheme/Content/styles.css"));
}


@using Nop.Web.Framework;
@{
    Html.AppendCssFileParts(Url.Content("~/Themes/nopClassic/Content/styles.css"));
}

The 2.4 version of this file was
@using Nop.Web.Framework;
<link href="@Html.ResolveUrl("~/Themes/customtheme/Content/styles.css")" rel="stylesheet" type="text/css" />


Does anyone know what I'm missing here?
12 years ago
Are you are missing the "Nop.Web.Framework.UI" namespace in your theme's Web.config?

See changeset 5319b367ed12.

.
12 years ago
changing the file back to the old 2.4 style of

@using Nop.Web.Framework;
<link href="@Html.ResolveUrl("~/Themes/customtheme/Content/styles.css")" rel="stylesheet" type="text/css" />


fixed the problem, does anyone know how to get it to work with the newer method?
12 years ago
mb wrote:
Are you are missing the "Nop.Web.Framework.UI" namespace in your theme's Web.config?

See changeset 5319b367ed12.

.


THANKYOU SOOOOO MUCH.

Didn't even notice that Web.config file in the views folder.
12 years ago
Is there a simple way to set the ORDER of which the <link /> elements get output? I am overriding some default css with my own and the problem I am getting is that my style sheets gets added before the default one instead of the after (as expected).

Filip
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.