微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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中也有相应注释。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐