2014-12-18 1 views
0

오차드 CMS 1.8.1 빵 부스러기에 마이크로 데이터를 추가하려고합니다.과수원 마이크로 데이터 빵 부스러기

/Core/Shapes/Views에서 가져온 breadcrumbs.cshtml에 itemprop = "child"를 추가해야합니다.이 중 내 테마보기 폴더에 추가 한 항목이 있습니다. 잘 작동하지만 itemprop = "child"를 표시하지 않습니다. 아래의 breadcrumbs 코드에 .Itemprop.Add ("child")로 추가했습니다. 그러나 하위 속성은 내 테마 MenuItemLink.cshtml에 추가 나에게 빵 부스러기하지만 자식 속성에 대한 모든 마이크로 데이터를 제공 폴더를 전망 한

@{ 
 
    // Model is Model.Menu from the layout (Layout.Menu) 
 
    var tag = Tag(Model, "ul"); 
 
    tag.AddCssClass("breadcrumb"); 
 

 
    var items = (IList<dynamic>)Enumerable.Cast<dynamic>(Model.Items); 
 

 
    if(items.Any()) { 
 
     items[0].Classes.Add("first"); 
 
     items[items.Count - 1].Classes.Add("last").Itemprop.Add("child"); 
 
    } 
 
} 
 
<nav itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"> 
 
    @tag.StartElement 
 
     @* see MenuItem shape template *@ 
 
     @DisplayChildren(Model) 
 
    @tag.EndElement 
 
</nav>

표시되지 않습니다.

<a itemprop="url" href="@Model.Href"><span itemprop="title">@Model.Text</span></a>
방법 또는 내가에는 itemprop = "아이"를 추가 할 수있는 과수원과 모든 것이 @DisplayChildren (모델)에 의해 추가로 작동 얻을.

답변

0

변화

items[items.Count - 1].Classes.Add("last").Itemprop.Add("child"); 

items[items.Count - 1].Classes.Add("last"); 
items[items.Count - 1].Attributes.Add("itemprop", "child"); 

에는 항목 [items.Count - 1] -는 Shape 클래스이다. 클래스 - 모양에 대한 IList<string> 컬렉션 클래스입니다. 속성 - 모양에 대해 IDictionary<string, string> 콜렉션 속성입니다.