简体   繁体   English

Sitefinity 4+-在Sitefinity 4-5.x中标准化站点内模块

[英]Sitefinity 4+ — Standardizing intra-site modules in Sitefinity 4-5.x

We write a lot of intrasite modules and are noticing that they really deviate now in SF 4+ from the content-based ones. 我们编写了许多内部站点模块,并注意到它们现在在SF 4+中确实偏离了基于内容的模块。 So, on that note, I have some questions: 因此,关于该注释,我有一些问题:

  1. How do you get the EXACT look and feel of the standard modules for the edit/create form? 您如何获得用于编辑/创建表单的标准模块的精确外观? For example, how do you eliminate the menu above, center the form, etc, as in, say, the Events module? 例如,如何消除上面的菜单,使窗体居中等,例如在“事件”模块中?
  2. How do you add an actions menu dropdown to a radgrid, same as you'd see in the grids for standard modules? 您如何向radgrid添加一个动作菜单下拉菜单,就像在标准模块的网格中看到的一样?
  3. How do you incorporate Sitefinity fields into the usercontrols? 如何将Sitefinity字段合并到用户控件中? For example sf:ImageField throws script errors when added to a control? 例如sf:ImageField添加到控件时会引发脚本错误吗? Also, is there documentation on each of these fields and how to configure? 此外,是否有关于每个字段的文档以及如何配置?

---finally--- - -最后 - -

If we really want that standardization, do we have to go with another module type? 如果我们真的想要这种标准化,是否必须使用其他模块类型?

4.Is there a module type that will allow us to access non-sitefinity data (ie separaate db 4.是否有一个模块类型可以让我们访问非站点数据(即分离数据库)
but also provide us with exactly the same functionality and UI experience as the content- based modules? 还能为我们提供与基于内容的模块完全相同的功能和UI体验吗?

intra site modules are simply custom user controls (ascx) placed into backend pages to add your custom functionality to the backend. 内部站点模块只是放置在后端页面中的自定义用户控件(ascx),以将自定义功能添加到后端。 To copy the look and feel of the rest of the site, I literally copy and paste the HTML into the control. 为了复制网站其余部分的外观,我从字面上复制了HTML并将其粘贴到控件中。

I did a webinar on this a while back, including code to recreate the backend editor. 不久前,我进行了一次网络研讨会,其中包括重新创建后端编辑器的代码。 It appears to still be valid, and is available here: http://www.sitefinity.com/blogs/joshmorales/posts/josh-morales-blog/2011/06/30/sitefinity_intra-site_module_webinar_notes 它似乎仍然有效,并且可以在以下位置找到: http : //www.sitefinity.com/blogs/joshmorales/posts/josh-morales-blog/2011/06/30/sitefinity_intra-site_site_module_webinar_notes

the centered view is a bit different, and I don't have that html, but you could potentially do the same (copy it from another native page). 居中视图有点不同,而且我没有该html,但是您可能会做同样的事情(从另一个本机页面复制它)。 I don't always get it 100% accurate (my controls are usually laid out different from what Sitefinity does) but I get close enough so that it doesn't break the user experience. 我并非总能做到100%准确(我的控件通常与Sitefinity的布局不同),但是我已经足够亲密,因此不会破坏用户体验。

The actions menu could be recreated with javascript, but if you are looking for NATIVE integration that does all this for you, indeed you would be looking at inheriting or much better yet: simply using the module builder, which lets you build custom types that automatically install themselves into Sitefinity as if they were regular modules. 可以使用javascript重新创建action菜单,但是如果您正在寻找能为您完成所有这些工作的NATIVE集成,那么实际上您会在考虑继承或做得更好:只需使用模块构建器,该模块即可自动构建自定义类型将自己安装到Sitefinity中,就像它们是常规模块一样。

Fields are definitely designed to run inside the context of native sitefinity module definitions (the classes that make up the UI using the Sitefinity context). 字段绝对设计为在本地sitefinity模块定义(使用Sitefinity上下文构成UI的类)的上下文中运行。 This doesn't mean you can't include Sitefinity content in your modules; 这并不意味着您不能在模块中包含Sitefinity内容; it simply means if you do you'll have to implement the integration yourself using the API. 它只是意味着,如果需要,您将必须使用API​​自己实现集成。

On your last question, the only way to use external data but still keep the "Sitefinity Content" UI is to inherit from Content, then create a custom provider that reads from your database and translates it into the Sitefinity content type. 关于最后一个问题,使用外部数据但仍保留“ Sitefinity Content” UI的唯一方法是从Content继承,然后创建一个自定义提供程序,该提供程序从数据库中读取并将其转换为Sitefinity内容类型。 It is certainly possible, but is quite a big project. 当然有可能,但这是一个很大的项目。

Unless you are in full need of this tight integration, I recommend simply going intra-site, linking to Sitefinity content types,taxonomy, etc through the API and manage it separately. 除非您完全需要这种紧密的集成,否则我建议您只进行站点内访问,通过API链接到Sitefinity内容类型,分类法等,然后分别进行管理。

I hope this was helpful! 我希望这可以帮到你!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM