2013-08-21 3 views

답변

10

먼저 당신은 명령 클래스를 작성해야합니다. 가장 간단한 버전은 다음과 같습니다

using System; 
using Sitecore.Shell.Applications.WebEdit.Commands; 
using Sitecore.Shell.Framework; 
using Sitecore.Shell.Framework.Commands; 

namespace my.assembly.namespace 
{ 
    [Serializable] 
    public class Publish : WebEditCommand 
    { 
     public override void Execute(CommandContext context) 
     { 
      if (context.Items.Length != 1) 
       return; 
      Items.Publish(context.Items[0]); 
     } 
    } 
} 

등록 새 명령 Sitecore.config (또는 Commands.config)에서 : 다음

<configuration> 
    <sitecore> 
    <commands> 
     <command name="my:publish" type="my.assembly.namespace.Publish,my.assembly"/> 
    </commands> 
    </sitecore> 
</configuration> 

님의

  1. 로그인 Sitecore 데스크톱
  2. 스위치 데이터베이스 코어
  3. 중복 /sitecore/content/Applications/WebEdit/Common Field Buttons/Edit related item
  4. 마스터
  5. 스위치 데이터베이스 다시 (Tooltip, Header, Icon) 항목의 my:publish
  6. 변경 다른 속성이 항목의
  7. 설정 Click 재산 Publish related item에 새 항목의 이름을 변경
  8. 열기 페이지 편집기 및 새 명령을 테스트하십시오. uld 관련 항목이 ID 인 표준 게시 팝업을 URL의 매개 변수로 엽니 다.
2

코드 변경없이 구현할 수 있습니다.

<command name="webedit:publish" type="Sitecore.Shell.Framework.Commands.PublishItem,Sitecore.Kernel" /> 

위의 항목을 Commands.config 파일에 추가하십시오. 이 파일은 포함 폴더에서 사용할 수 있습니다.

  • 스위치 데이터베이스 핵심
  • 중복/sitecore/콘텐츠/응용 프로그램/WebEdit와/공통 필드 버튼/편집 관련 항목
  • 게시 할 새 항목의 이름을 변경 관련 항목
  • 에 Sitecore 바탕 화면

    1. 로그인
    2. 데이터베이스를 마스터로 다시 전환하십시오.
    3. 열기 페이지 편집자 (일반 : edititem ({command : "webedit : 게시"))이 항목의 Click 속성을 chrome으로 설정하십시오. r을 실행하고 새 명령을 테스트합니다 (관련 항목 ID가 URL의 매개 변수와 함께 표준 게시 팝업을 열어야 함).

    감사

    Fenil

  • 관련 문제