功能激活网页级别 [英] Feature Activation Web Level

查看:55
本文介绍了功能激活网页级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

需要帮助来尝试解决此问题.

Need help to try to solve this problem.

我有一个项目,该项目具有2个功能,一个在Site Scope,另一个在Web Scope,站点范围功能将始终在部署时激活,我不想使用该Web范围,它将仅用于基于我创建的网站定义的新网站 在同一项目中(列,内容类型,列表).我在onet.xml中具有此功能激活guid,它在我创建的网站中运行良好.但是每次我部署项目时,它都会在站点级别激活此功能,而我不想 那个.

I have a project that has 2 features, one at Site Scope and another one at Web Scope, the Site scope feature will be always activated on deploy, the web scope i don't want to, it will be used only for new web sites based on a site definition that i created in the same project (Columns, Content Types, Lists). I have this feature activation guid in the onet.xml and it works fine in the web sites that i created . But everytime that i deploy the project it activates this feature at the site level and i dont want that.

我查看了Feature属性,并看到了默认时激活"属性,但是在检查MSDN后,它显示: 

I looked to the the Feature properties and i saw the properties Activate On Default, but after checking MSDN it says: 

可选" span> Boolean TRUE   if 该功能会在安装过程中或创建Web应用程序时默认激活;    if 该功能未激活.此属性等于   默认.   ;属性 不适用于网站集( ) 或网站( ) 范围内的功能.

"Optional BooleanTRUE if the Feature is activated by default during installation or when a Web application is created; FALSE if the Feature is not activated. This attribute equals TRUE by default. The ActivateOnDefault attribute does not apply to site collection (Site) or Web site (Web) scoped Features.

通常,农场作用域的功能会在安装过程中被激活,并且在创建新的Web应用程序时,所有已安装的

In general, Farm-scoped Features become activated during installation, and when a new Web application is created, all installed Web application-scoped Features in it become activated."

所以它不起作用,如何在同一个Package中激活一个而又不激活另一个.

So it doesn't work, how can I in the same Package activate one and doesn't activate the other. 

在项目中,我将"Active Deployment Configuration"(活动部署配置)设置为"Default"(默认),并且我不希望/可以更改此设置.

任何解决方法?

In the project i have the Active Deployment Configuration set to Default, and i don't want/can change this.

Any workaround?

更改功能范围服务器场,仅使用属性并将其设置为隐藏,并在创建具有自定义webapplicaiton功能的新站点时通过代码将其强制激活?
还是尝试其他方法,我知道我可以在onet,xml中创建列表,但是可以创建列和内容类型?有可能吗?

谢谢

Change the feature scope farm, just to use the propertie and set it to hidden, and by code, when creating a new site, with a custom webapplicaiton feature, force the activation of the first one?
Or trying a different approach, I know that i can create lists in the onet,xml, but columns and content types? It's that possible?

Thanks

仅从共享点开始...

Just starting with sharepoint...

推荐答案

在SharePoint中,最好的功能之一是功能装订".通过这种概念,我们可以将SharePoint功能添加到网站定义中,而无需直接修改网站定义.

In SharePoint one of the best feature is "Feature Stapling". By this concept we can staple the SharePoint feature to site definition without directly modifying the site definition.

请点击下面的链接以获取更多详细信息:

Please follow the below link to get more details on this:

https://msdn.microsoft.com/en-us/library/ff649469.aspx

这可以帮助您达到要求.

This could help you to achieve your requirement.

谢谢

Siva


这篇关于功能激活网页级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆