[英]A whole website section as a DotNetNuke module
I need to develop a whole section of a website (around 10 different pages) as a DotNetNuke module.我需要开发一个网站的整个部分(大约 10 个不同的页面)作为 DotNetNuke 模块。 The site will be using DNN as the CMS, where editors will manage HTML content for most of the website (exception that section I'll be developing).该网站将使用 DNN 作为 CMS,编辑将在其中管理大部分网站的 HTML 内容(我将开发的部分除外)。
I've already made a rather extensive research on DNN Module Development (even watched some recorded Webinars by DNN Corp).我已经对 DNN 模块开发进行了相当广泛的研究(甚至观看了 DNN Corp 录制的一些网络研讨会)。 Unfortunately, most of what I could find online is about developing simple, widget-like modules.不幸的是,我在网上能找到的大部分内容都是关于开发简单的、类似小部件的模块。 Also, most of it uses a step-by-step "how to use visual studio to acomplish x" approach, while I was trying to understand how DNN works.此外,其中大部分使用分步“如何使用 Visual Studio 完成 x”的方法,而我试图了解 DNN 的工作原理。 So it seems I have to figure it out for myself...所以看来我得自己想办法了……
At this point I'm already somewhat familiar with DNN, and I see several different solutions to my problem:在这一点上,我已经对 DNN 有点熟悉,并且我看到了几种不同的解决方案来解决我的问题:
So I decided to ask you guys for advice.所以我决定向大家征求意见。 Which is the the preferred way to go? go 的首选方式是哪种? Maybe none of the above?也许以上都没有? I know all four options above should give me the result I want, but I also don't want to go against the "DNN way" too much...我知道上面的所有四个选项都应该给我想要的结果,但我也不想 go 反对“DNN 方式”太多......
I wouldn't recommend #1 (multiple modules) or #3 (also multiple modules) at all, and though #2 (single module w/ module level setting that determines view) is definitely a solid option used widely by DNN module developers, it sounds like you'd prefer #4 (Razor) over #2 because you like the development style.我根本不推荐#1(多个模块)或#3(也是多个模块),尽管#2(确定视图的具有模块级别设置的单个模块)绝对是DNN模块开发人员广泛使用的可靠选项,听起来你更喜欢#4(Razor)而不是#2,因为你喜欢开发风格。
So - I'd recommend going with the Razor approach, which though it seems like you understand the approach just fine, I wanted to elaborate on for posterity:所以-我建议使用 Razor 方法,尽管您似乎很好地理解了该方法,但我想为后代详细说明:
That should work out quite well.这应该会很好。
I'm assuming you're looking at developing your software in the "Web Site Project" style.我假设您正在考虑以“网站项目”风格开发您的软件。 I'll like to recommend that you look at the "Web Application Project" style of doing things.我会推荐你看看“Web 应用程序项目”的做事风格。
If you have shared functionality in a library, feel free to build an assembly and drop it in the bin folder, from there, it will be picked up by DNN and it will run in the http context, which is great!如果您在库中共享功能,请随意构建一个程序集并将其放入 bin 文件夹,从那里,DNN 将拾取它,它将在 http 上下文中运行,这很棒!
Build your module in one project and package the different modules in your DNN manifest.在一个项目中构建您的模块,并在您的 DNN 清单中构建不同的模块。
Hope i'm not talking about what you understand.希望我不是在谈论你所理解的。
Added another answer, it's a post in itself.添加了另一个答案,它本身就是一个帖子。
Modules - That's a term that's very loosely used by all of us.模块 - 这是一个我们所有人都非常松散地使用的术语。
Clearer Definitions更清晰的定义
The manifest allows you to define Modules(group of View/Edit/Settings) user controls as a single installation package.清单允许您将模块(查看/编辑/设置组)用户控件定义为单个安装 package。
In the DNN 3.0 manifest, if you're still in this format, you'll notice that a basic single installation package is structured like this (briefly)在 DNN 3.0 清单中,如果您仍然采用这种格式,您会注意到一个基本的单一安装 package 的结构是这样的(简要)
<dotnetnuke version="3.0" type="Module">
<folders>
<folder>
<name>Side bar Navigation</name>
<modules>
<module>
<friendlyname></friendlyname>
<cachetime>0</cachetime>
<controls>
<control>
<title>View</title>
<src>DesktopModules/Module/View.ascx</src>
<type>View</type>
</control>
<control>
<key>Settings</key>
<title>Settings</title>
<src>DesktopModules/Module/Settings.ascx</src>
<type>Edit</type>
</control>
</controls>
</module>
</modules>
<files>
...
</files>
</folder>
</folders>
</dotnetnuke>
So that above defines a Single Module in an Installation Package.因此,上面定义了安装 Package 中的单个模块。
In the context of a blog, you would have 2 modules在博客的上下文中,您将有 2 个模块
What you can do is to package the Blog Display Module in the manifest in a copy of <folder></folder>
and then the Sidebar Navigation Module in another copy of the <folder></folder>
structure.您可以做的是将清单中的博客显示模块 package 放在<folder></folder>
的副本中,然后将侧边栏导航模块放在<folder></folder>
结构的另一个副本中。
For example, this project has 7 modules;比如这个项目有7个模块; Side bar navigation, custom search module, blah blah blah侧边栏导航,自定义搜索模块,等等等等
<dotnetnuke version="3.0" type="Module">
<folders>
<folder>...</folder>
<folder>...</folder>
<folder>...</folder>
<folder>...</folder>
<folder>...</folder>
<folder>...</folder>
<folder>...</folder>
</folders>
</dotnetnuke>
They have different views, names, friendlynames but all share one common <foldername>
它们有不同的视图、名称、友好名称,但都共享一个共同的<foldername>
The KEY is in the Packaging.关键在包装中。
<folder>
<name>BlogDisplay</name>
<friendlyname>Blog Display</friendlyname>
<foldername>WebLog</foldername>
<modulename></modulename>'
'<folder>
<name>BlogSidebar</name>
<friendlyname>Sidebar Navigator</friendlyname>
<foldername>WebLog</foldername>
<modulename></modulename>
It'll look something like this.它看起来像这样。 that's where foldername is.那就是文件夹名称所在的位置。 It defines where in DesktopModules your module will be installed to.它定义了您的模块在 DesktopModules 中的安装位置。
In DNN 5 books, the Web Site Project method of development is still in use but when you're participating in development on the Core Modules, you'll find that the projects are in Web App Project development style, which is better, because all your code-behind is in an assembly and not exposed as source code on the web.在 DNN 5 书籍中,Web Site Project 的开发方法仍在使用,但是当您参与 Core Modules 的开发时,您会发现项目采用 Web App Project 开发风格,更好,因为所有您的代码隐藏在程序集中,而不是作为 web 上的源代码公开。
You're definitely on the right path.你绝对是在正确的道路上。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.