开发者

What is the groupId parameter in the IContentManager.BuildDisplay method of Orchard for?

The method IContentManager.BuildDisplay used to call to the drivers of a ContentItem has an optional groupId argument. I have navigated through the source code but I did not understand exactly wh开发者_如何转开发at is its use case. It seems to be able to filter shapes, but I'm not sure I understand how.

Could you clarify this for me? Thanks in advance.


Yes, this parameter is used for filtering shapes. You can provide an optional parameter via .OnGroup() method of ContentShape object returned from Display/Editor method of a driver.

By default it's an empty string. If you provide a groupId parameter in BuildDisplay - only the shapes with that group id specified would be taken into account when building the final output.

I found it particularly useful when needed to render the same part differently in different scenarios - returning a Combined result with ContentShape objects (each with different group specified) in it from the driver's Display method.

Remember that if you explicitly specify a group in BuildDisplay method - only the shapes with that group set will be used.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜