2012-05-28 31 views
10

來自Tridion星球的所有人類的一個大「嗨」:)。是否可以在SDL Tridion UI 2012中編輯組件鏈接?

我試圖讓組件鏈接在支持SDL Tridion UI 2012

編輯我有一個包含多值組件鏈接作爲字段中的一個一個組成部分。

,當我把下面的DWT

<!-- TemplateBeginRepeat name="componentLink" --> 
<!-- TemplateBeginIf cond="TemplateRepeatIndex<3" --> 
    <li> 
    <a href="#" tridion:href="@@RenderComponentField(FieldPath+"componentLink",TemplateRepeatIndex)@@"> 
    Link${TemplateRepeatIndex} 
    </a> 
    </li> 
<!-- TemplateEndIf --> 
<!-- TemplateEndRepeat --> 

內模板生成器,結果我得到了以下幾點:

<li><a href="#" tridion:href="<tcdl:ComponentField name="componentLink" index="0">tcm:8-625</tcdl:ComponentField>">Link0</a></li> 
<li><a href="#" tridion:href="<tcdl:ComponentField name="componentLink" index="1">tcm:8-626</tcdl:ComponentField>">Link1</a></li> 
<li><a href="#" tridion:href="<tcdl:ComponentField name="componentLink" index="2">tcm:8-627</tcdl:ComponentField>">Link2</a></li> 

由於在頁面上預期的「默認完成操作」時發生錯誤級別

無法找到適當的tridion值:href

是否需要在以前的某個操作中提取C#TBB中的組件鏈接或以其他任何方式解決此問題(啓用SDL Tridion UI的組件鏈接)?

+0

你的意思是你想使鏈接的組件的內容編輯,或鏈接本身? –

+0

沒關係 - 看代碼示例,它看起來像後者。 –

回答

10

在我的「新UI VM」我有一個設計,下面的代碼:

<tcdl:ComponentField name="LinkText"> 
    <a tridion:href="@@[email protected]@">${LinkText}</a> 
</tcdl:ComponentField> 

鏈接的組件是在新的UI編輯。處理tcdl:ComponentField以在鏈接周圍包裝適當的上下文編輯指令。你應該能夠很容易地將它翻譯成你的代碼...

6

謝謝你傑里米,手動添加<tcdl:ComponentField>標籤解決了這個問題。

這裏是最後的代碼,正確地解決在頁面級別組件鏈接:

<!-- TemplateBeginRepeat name="componentLink" --> 
    <!-- TemplateBeginIf cond="TemplateRepeatIndex<3" --> 
     <li> 
      <tcdl:ComponentField name="componentLink"> 
       <a tridion:href="@@[email protected]@">Link${TemplateRepeatIndex} </a> 
      </tcdl:ComponentField> 
     </li> 
    <!-- TemplateEndIf --> 
<!-- TemplateEndRepeat --> 
相關問題