开发者

Drupal multiple features and unreusable components

This is a general question on how Features should be created when we have components that could potentially be used in multiple features.

Suppose a context (c1) takes a view (v1) and is added to a feature (f1). Now let's say v1 has potential use somewhere else and i want to create a new feature (f2) to include it in...but the Features module doesn't give you the option to do so. The only thing i can do is cloning v1 into v2 and use that in f2.

I may be shortsighted, but I think that if f2 needed v1, then just add the other components that would make up f2 and put them in f1...because more likely than not, those two features would be closely related (see One big feature...), at least enough to warrant using the same view (which in turn co开发者_高级运维uld include the same node types, roles, etc...)

I guess i'm just curious, has there been a case where you've created a feature with a view, and then needed to have a different feature using that same view?


The easiest solution in your case is to add a dependency from f2 to f1 to make sure that you have your v1 available. You can't add v1 in f2 a second because your view would be defined twice and features would create a circular dependency.

Otherwise, to create reusable components, you should clone your view to make sure that you have "everything" you need in one same feature.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜