2016-11-22 13 views
0

Мы находимся на sitecore 8.1 update 3 и Glass Mapper 4.2.1.188.RenderLink скрыт в режиме редактирования опыта

Render Link работает в нормальном режиме, но мы смотрим на ту же ссылку в режиме опыта, что скрыты?

Бритва Код: источник

<div class="c-home__cta"> 
    @RenderLink(x => x.CallToActionButton, new { @class = "c-btn c-btn--strong c-btn--large" }, isEditable: true) 
</div> 

Страница режима редактора опыт:

<input id='fld_445CAE7C73764E3BBE7298BB2F1AC2F7_8381EE66B5A54D74B92C9171CD688959_en-GB_7_d1e84aa9693343f28b3b8ac3a0990b8d_35' class='scFieldValue' name='fld_445CAE7C73764E3BBE7298BB2F1AC2F7_8381EE66B5A54D74B92C9171CD688959_en-GB_7_d1e84aa9693343f28b3b8ac3a0990b8d_35' type='hidden' value="&lt;link linktype=&quot;internal&quot; text=&quot;Discover More&quot; querystring=&quot;&quot; target=&quot;&quot; id=&quot;{8CBC614A-F2B4-4842-81DA-BE4B57992547}&quot; /&gt;" /><span class="scChromeData">{"commands":[{"click":"chrome:field:editcontrol({command:\"webedit:editlink\"})","header":"Edit link","icon":"/temp/iconcache/networkv2/16x16/link_edit.png","disabledIcon":"/temp/link_edit_disabled16x16.png","isDivider":false,"tooltip":"Edits the link destination and appearance","type":""},{"click":"chrome:field:editcontrol({command:\"webedit:clearlink\"})","header":"Clear Link","icon":"/temp/iconcache/networkv2/16x16/link_delete.png","disabledIcon":"/temp/link_delete_disabled16x16.png","isDivider":false,"tooltip":"Clears The Link","type":""},{"click":"chrome:common:edititem({command:\"webedit:open\"})","header":"Edit the related item","icon":"/temp/iconcache/office/16x16/cubes.png","disabledIcon":"/temp/cubes_disabled16x16.png","isDivider":false,"tooltip":"Edit the related item in the Content Editor.","type":"common"},{"click":"chrome:rendering:personalize({command:\"webedit:personalize\"})","header":"Personalize","icon":"/temp/iconcache/office/16x16/users_family.png","disabledIcon":"/temp/users_family_disabled16x16.png","isDivider":false,"tooltip":"Create or edit personalization for this component.","type":"sticky"},{"click":"chrome:rendering:editvariations({command:\"webedit:editvariations\"})","header":"Edit variations","icon":"/temp/iconcache/office/16x16/windows.png","disabledIcon":"/temp/windows_disabled16x16.png","isDivider":false,"tooltip":"Edit the variations.","type":"sticky"}],"contextItemUri":"sitecore://master/{445CAE7C-7376-4E3B-BE72-98BB2F1AC2F7}?lang=en-GB&ver=7","custom":{},"displayName":"Call to action button","expandedDisplayName":null}</span><span scFieldType="upm general link" scDefaultText="[No text in field]" contenteditable="true" class="scWebEditInput" id="fld_445CAE7C73764E3BBE7298BB2F1AC2F7_8381EE66B5A54D74B92C9171CD688959_en-GB_7_d1e84aa9693343f28b3b8ac3a0990b8d_35_edit"><link linktype="internal" text="Discover More" querystring="" target="" id="{8CBC614A-F2B4-4842-81DA-BE4B57992547}" /></span> 

будут оценены любые предложения.

ответ

2

По умолчанию текст, отображаемый пользователю в ссылке, является либо значением из поля «Описание» для внешних ссылок, либо именем целевого элемента Sitecore, я думаю, что у вас эти значения пусты, вы можете переопределить текст ссылки по содержимому параметр, поэтому просто добавьте текст или пустое пространство для содержимого, если страница в режиме редактирования:

@if (Sitecore.Context.PageMode.IsExperienceEditorEditing) 
{ 
RenderLink(x => x.CallToActionButton, new { @class = "c-btn c-btn--strong c-btn--large" }, isEditable: true,contents: "some text") 
} 
else 
{ 
RenderLink(x => x.CallToActionButton, new { @class = "c-btn c-btn--strong c-btn--large" }) 
}