Nop3.9的下载与使用

一:中文资源

先去nop官网,下载3.9中文包,此中文包翻译不全,在定制的过程中,可以慢慢修改。官网地址 www.nopcommerce.com。

进去后台 Configuration -> Languages

添加一条简体中文的记录,保存后导入中文包,页面顶部切换语言即可。

二:UI汉化

Libraries -> nop.Core -> CommonHelper - > SetTelerikCulture() 方法

Presentation -> nop.Admin -> Views -> Shared -> _AdminLayout.cshtml

添加引用

Html.AppendScriptParts(string.Format(~/Administration/Scripts/kendo/{0}/cultures/kendo.culture.zh-CN.min.js, kendoVersion));
Html.AppendScriptParts(string.Format(~/Administration/Scripts/kendo/{0}/cultures/kendo.messages.zh-CN.js, kendoVersion));
<script>kendo.culture(zh-CN);</script>

三:编辑器

个人不太喜欢认的编辑器,使用百度的UEditor富文本编辑器。UEditor官网

Presentation -> nop.Web -> Content 下创建文件夹 uditor,将下载的文件copy至uditor文件夹中。

Presentation -> nop.Admin -> Views -> Shared -> EditorTemplates 下创建页面 UEditor.cshtml

@model String
@using nop.Core
@using nop.Core.Domain.Common
@using nop.Services.Security
@using nop.Web.Framework.UI
@{
    Html.AddScriptParts(~/Content/ueditor/ueditor.config.js);
    Html.AddScriptParts(~/Content/ueditor/ueditor.all.js);
    Html.AddScriptParts(~/Content/ueditor/lang/zh-cn/zh-cn.js);
}<script>UE.getEditor(@ViewData.TemplateInfo.GetFullHtmlFieldId(string.Empty), {
        initialFrameWidth: 100%,initialFrameHeight: 400});</script>@Html.TextArea(string.Empty, /* Name suffix */ViewData.TemplateInfo.FormattedModelValue /* Initial value */)

后台调用编辑器

效果如下:

关于样式和文件下载路径和其他配置,去看api文档即可,js中也有相应注释。

相关文章

目录简介使用JS互操作使用ClipLazor库创建项目使用方法简单测...
目录简介快速入门安装 NuGet 包实体类User数据库类DbFactory...
本文实现一个简单的配置类,原理比较简单,适用于一些小型项...
C#中Description特性主要用于枚举和属性,方法比较简单,记录...
[TOC] # 原理简介 本文参考[C#/WPF/WinForm/程序实现软件开机...
目录简介获取 HTML 文档解析 HTML 文档测试补充:使用 CSS 选...