该站点需要进行一些广泛的自定义,并且我对可维护性和更新的关注之一.我需要确保在升级到NopCommernce的新版本时,我不会在脚下拍摄并真正使事情变得困难.我很久以前就学会了总是尝试在这些系统之上添加并尽可能地保留系统代码.
我发现this question关于覆盖视图,如果我正确地假设视图存在于主题下(遵循相同的结构),那么将使用该视图,否则默认视图将从根“视图”文件夹中使用?
我似乎无法找到很多关于自定义站点的管理员端,并且不确定如何在不触及源的情况下自定义它.基本上我需要完成的是提供管理区域的精简版本,如果你愿意的话,提供“虚拟证明”版本.使用访问控制和可能的自定义客户角色来隐藏我需要提供自定义界面的任何区域,例如输入新的产品或属性并提供插件并将其添加到管理员菜单,会更明智吗?或者最好将整个事情作为一个完全独立的插件在公共方面完成并让管理员完全脱离它?我还没有足够的经验使用这个系统,我想避免任何许可问题和/或打开安全漏洞,因为它位于一个单独的区域.
我也很感激NopCommerce一般应该注意的任何提示或问题.我找到了不少网站,但这些网站似乎都参考了V2或V3,我不确定自那时以来是否有任何重大变化.
谢谢!
更新
如果还有其他人正在寻找相同的信息,除了答案之外,我还能找到其他人可能会发现有用的链接来解决这个问题.
> NopCommernce Forum – Override Admin Views and Admin Controllers
> Overriding NopCommerce Admin Views and Partial Views
> Overriding and Adding Views With a NopCommerce Plugin
> 3 Ways to Display Views in Your nopCommerce Plugins (Embedded Resource,Theme Override and Custom View Engine)
> Override Existing Controller & Action in Nop Version 4.0
> Where to register custom view engine in Nop 4.0
解决方法
Maintainability and updates.
根据我与nopCommerce合作,可以轻松维护和升级项目.但是,这取决于您将遵循的实践.有几种常用方法可以使自定义代码超过默认代码.最好的方法是为您的需求开发一个插件,这将使升级过程无缝.
但是,当nopCommerce转向更新的技术时,更新现有网站会很麻烦,nopCommerce 3.90到4.0的升级会发生什么,转移到ASP.NET核心是一个巨大的变化.但是,通过适当的技术知识,您可以轻松完成.
I learned long ago to always try and add on top of these systems and leave the system code alone whenever possible
是的,这是开发人员最喜欢的,不要触摸默认代码并在系统上运行代码,这就是可插拔架构所用的.
if the view is present under the theme (following the same structure)
then that view will be used otherwise the default view is used from
the root ‘Views’ Folder?
是的,首先它在主题文件夹下呈现视图页面,然后在根视图页面之后呈现.两者都可以从插件中覆盖.
how to customize it without touching the source
Would it be wiser to use the Access Control and possibly custom
Customer Roles to hide any areas that I need to provide a custom
interface for,such as entering new Products or Attributes and provide
a Plugin instead and add that to the Admin Menu.
您可以创建新角色并处理ACL(Access Control List
)
Or would it be better to do this whole thing as a totally separate Plugin on the Public side and leave the admin side totally out of it?
这取决于您的要求,如果您想在管理员侧或前端进行更改,这两件事都可以通过插件进行管理.
希望这可以帮助!