这部分有问题。最后一个标签,当我单击class ='learnmore'时,它将提示'无法读取未定义的属性'top'
@ { var j = 0; } @foreach(在原因Container.Children中的item reasonItem){ @ Html.Sitecore()。Field(“产品介绍图片”,原因项) @ Html.Sitecore()。Field(“产品介绍图片”,原因项) @ Html.Sitecore()。Field(“产品介绍标题”,原因项) @ Html.Sitecore()。Field(“产品介绍字幕”,原因项) @ { Sitecore.Data.Fields.MultilistField videoslide =(Sitecore.Data.Fields.MultilistField)reasonItem.Fields [“幻灯片产品选项”]; if(videoslide!= null && videoslide.GetItems()。Count()> 0) { foreach(videoslide.GetItems()中的Sitecore.Data.Items.Item幻灯片项目){ @if(slideitem.Fields [“ product Youtube Video Link”]!= null && slideitem.LinkUrl(“ product Youtube Video Link”)!=“”) { @ Html.Sitecore()。Field(“产品介绍视频图像”,slideitem) } 其他 { @ Html.Sitecore()。Field(“产品介绍视频图像”,slideitem) } } } 其他{ @if(reasonItem.Fields [“ product Youtube Video Link”]!= null &&原因Item.LinkUrl(“ product Youtube Video Link”)!=“”){ @ Html.Sitecore()。Field(“产品介绍视频图像”,原因项) } 其他{ @ Html.Sitecore()。Field(“产品介绍视频图像”,原因项) } } } @ Html.Sitecore()。Field(“产品介绍内容”,reasonItem) <div class="jumbotron full-text-title text-center">
<h2>
@Html.Sitecore().Field("Popular Product Title", reasonItem)
</h2>
</div>
<div class="row reference panel-group panel-group-@j carousel multi3carousel ">
@{
Sitecore.Data.Fields.MultilistField productRepository = reasonItem.Fields["Popular Product Options"];
int i = 1;
foreach (Sitecore.Data.Items.Item item in productRepository.GetItems())
{
Sitecore.Data.Fields.ReferenceField linkTextReference_2 = item.Fields["Teaser Link Text"];
Sitecore.Data.Items.Item linkText_2 = linkTextReference_2.TargetItem;
double delay= i * 0.2;
<div class="product-item carouselitem col-xs-12 panel thumbnail text-center" >
<div class="panel-heading">
<div class="panel-title">
</div>
</div>
<div class="panel-body table">
<div class="table-cell">
<div class="title">
<h3>@Html.Sitecore().Field("Teaser Title", item)</h3>
@{String itemTitle = item.Name.ToLower();
if(itemTitle == "crisis xdefender"){
itemTitle = "crisis xdefender supreme";
}
}
</div>
<div class="caption">
<ul class="list-group" >
@if (item.Fields["Teaser Point 1"].ToString() != "") {
<li class="list-group-item">
<div class="pull-left">
<i class="fa fa-circle"></i>
</div>
<div class="text-left">
<p>@Html.Sitecore().Field("Teaser Point 1", item)</p>
</div>
</li>
}
@if (item.Fields["Teaser Point 2"].ToString() != "") {
<li class="list-group-item">
<div class="pull-left">
<i class="fa fa-circle"></i>
</div>
<div class="text-left">
<p>@Html.Sitecore().Field("Teaser Point 2", item)</p>
</div>
</li>
}
@if (item.Fields["Teaser Point 3"].ToString() != "") {
<li class="list-group-item">
<div class="pull-left">
<i class="fa fa-circle"></i>
</div>
<div class="text-left">
<p>@Html.Sitecore().Field("Teaser Point 3", item)</p>
</div>
</li>
}
</ul>
</div>
<div class="click-here text-center">
<a href="@Sitecore.Links.LinkManager.GetItemUrl(item)" class="primary-color text-uppercase full-width gtm-medical-campaign" gtm="@reasonItem.Name product detail: @itemTitle">@Html.Sitecore().Field("Title", linkText_2)<i class="fa fa-caret-right"></i></a>
</div>
</div>
</div>
</div>
i++;
}
j++;
}
</div>
<a href="#" data-target="#reasons-to-buy-click-@j" class="closemobile learnmore">
@Html.Sitecore().Field("learn more", reasonItem)
<span class="sublearntitle">@Html.Sitecore().Field("leave your message", reasonItem)</span>
</a>
</div>
}
</div>
}
未捕获的TypeError:无法读取未定义的属性“ top”