定制优化(episerver)阻止外部Div CSS类
是否可以将CSS类添加到自动生成的外部DIV中? 我有一个带有ViewModel和一个控制器的简单块,我需要修改此自动化的外部Div,还是选择删除它?
我查看了推荐的其他答案,即。
@Html.PropertyFor(model => model.CurrentBlock.ClientLogos, new
{
CustomTag = "ul",
CssClass = "list",
ChildrenCustomTagName = "li",
ChildrenCssClass = "list_item"
})
问题是当我使用此语法时,模型没有CurrentBlock属性???
我的模型必将与ViewModel在一起,我不确定它是否会影响这一点。我是优化的新手。
Is it possible to add css classes to auto-generated outer div for block element ?
I have a simple Block with a ViewModel and a Controller and I need modify this autogenerated outer div, or optionally remove it?
I looked at other answers to this question where it was recommended ie.
@Html.PropertyFor(model => model.CurrentBlock.ClientLogos, new
{
CustomTag = "ul",
CssClass = "list",
ChildrenCustomTagName = "li",
ChildrenCssClass = "list_item"
})
Problem is when I use this syntax, model has no CurrentBlock property ???
My model is bound to ViewModel, I'm not sure if it affects this. I am very new to Optimizely.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用自定义标签和CSS类。在您的示例中,CurrentBlock可能是ViewModel的一部分,您可以直接使用Model.ClientLogs。替代性,如果您想要更多控件,则可以使用编辑属性。
您可以在此处找到有关编辑属性的更多信息: https://docs.developers.optimizely.com/content-cloud/v11.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 content-cloud/docs/docs/adding-eding-ighting-editing-editing-istribition-attributes-using-roperty-web-------------web--------控制
You can use custom tag and css class. In your example CurrentBlock is probably part of the viewModel, you can directly use model.ClientLogs. Alternativly if you want more control you can use editing attributes.
You can find more information about editing attributes here: https://docs.developers.optimizely.com/content-cloud/v11.0.0-content-cloud/docs/adding-editing-attributes-using-property-web-control