Add Titleparts to plugin view

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 年 前
Hello,

I'm having a problem with adding Html.AddTitleParts to the view of my plugin. I followed the instructions of creating a simple plugin witch is working fine, showing "Hello world" after installing. (Nop version 3.8 - visual studio 2015) Now I want to add some of the Html.- and Append Parts. e.g.
//title
Html.AddTitleParts(T("PageTitle.Account").Text);

No matter what I try Html and T do not exist in the current context.

I have referenced:
Nop.Core
Nop.Data
Nop.Services
Nop.Web
Nop.Web.Framework
System.Web
System.Web.Mvc

I also copied web.config into my plugin.

Am I missing something?
7 年 前
GvB wrote:
Hello,

I'm having a problem with adding Html.AddTitleParts to the view of my plugin. I followed the instructions of creating a simple plugin witch is working fine, showing "Hello world" after installing. (Nop version 3.8 - visual studio 2015) Now I want to add some of the Html.- and Append Parts. e.g.
//title
Html.AddTitleParts(T("PageTitle.Account").Text);

No matter what I try Html and T do not exist in the current context.

I have referenced:
Nop.Core
Nop.Data
Nop.Services
Nop.Web
Nop.Web.Framework
System.Web
System.Web.Mvc

I also copied web.config into my plugin.

Am I missing something?


Try with==>

@using Nop.Web.Framework.UI
7 年 前
Thank you Sohel,

I've tried that already, For some reason I have only the namespace of Nop.Plugin.

Regards
7 年 前
GvB wrote:
Thank you Sohel,

I've tried that already, For some reason I have only the namespace of Nop.Plugin.

Regards


It should work. What's the wrong ?
7 年 前
The only Delta I can see with the other plugins, is that all other plugins are marked as "Checked in" (this is from visual studio) and my plugin is "pending add"

Could that be an issue?

Regards
7 年 前
Does the error only show in Intellisense in Visual Studio or do you also get an error when you build and run the plugin?

I ask because there are many posts on the forum about Razor Intellisense being broken in plugins: https://www.google.co.uk/#q=site:http:%2F%2Fwww.nopcommerce.com%2Fboards+intellisense
7 年 前
Thank you Pete,

The error is also there when I run the code. I already tried the intellisense posts because at first I thought this was the issue...

I'm very much stuck in this. As I mentioned earlier it looks like the plugin is not "acting" like the others. When I hoover over the new plugin it shows "Pending add" while the other plugins show "Checked in"

Regards
7 年 前
Would you post the actual run-time error that you are getting (in the browser)?  (Because it's not clear to me if you see the error during Build, or run-time)

"Pending add" and "checked in" are source control things and should not impact how it compiles or runs.
7 年 前
The error is in Dutch, sorry for that:

Serverfout in toepassing /.
Compilatiefout
Beschrijving: Er is een fout opgetreden bij het compileren van een bron die vereist is om aan deze aanvraag te voldoen. Controleer de volgende details van deze fout en pas waar nodig de broncode aan.

Foutbericht van compiler: CS0103: De naam T bestaat niet in de huidige context

Fout in bron:

Regel 4:  
Regel 5:      //title
Regel 6:      Html.AddTitleParts(T("PageTitle.Account").Text);
Regel 7:      //page class
Regel 8:      Html.AppendPageCssClassParts("html-account-page");


It says that "T" does not exists in this context
7 年 前
I cannot access namespaces other than Nop.Plugin in the view
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.