2014-06-19 1 views
0

저는 Extension Builder가 백엔드에 설치된 Typo3 6.2를 사용하고 있습니다. 전에 확장 기능을 빌드 한 적이 없으며 필요한 경우 확실하지 않지만 원하는대로 할 수 있습니다.Typo3 : 6.2의 모든 tt_content에 사용자 정의 필드를 추가하는 가장 간단한 방법

나는 gridelements 열 안에 중첩 된 각 페이지에 다양한 콘텐츠 유형이 있습니다. 타이프 스크립트에서 확인할 수있는 모든 콘텐츠 요소에 대해 '배경색'드롭 다운을 추가하고 그에 따라 수업을 할당하려고합니다.

목표 HTML, 여기에서 "녹색"과 "어두운 색"은 원하는 클래스입니다 추가 : 나는 TUTO의 소수를 발견했습니다

if{ 
    value = 1 <--- equal to the value of the drop-down 
    equals.field = background_colour <--- the name of my custom field 
} 
//Then add the class to the mark-up 

: 다음

<div class="row"> <-- gridelements 
    <div class="column size2"> <-- gridelements 

     <div class="module green"> <-- content element with green bg 
      Some content: could be text, image, news content, etc. 
     </div> 

     <div class="module dark"> <-- content element with dark bg 
      Some content: could be text, image, news content, etc. 
     </div> 

     <div class="module"> <-- content element with no bg selected 
      Some content: could be text, image, news content, etc. 
     </div> 

    </div> 
</div> 

내가 typoscript에서 "배경색"필드를 찾고있을 것으로 기대 방법 약이다 rials, 어느 것도 정말로 이것을하는 방법을 나에게 이야기하지 않는다. 이 사람은 완전히 새로운 내용 요소 유형을 만드는 방법을 알려줍니다, 또한 오히려 확장 빌더 이외의 Kickstarter는 사용 는 http://docs.typo3.org/typo3cms/extensions/news/latest/Main/Tutorial/ExtendingNews/

는 아는 사람 있나요 : http://castironcoding.com/resources/our-blog/sp/view/show/post/reason-6-for-choosing-typo3-custom-content-elements-and-extbase-again-part-23.html?tx_cicblog_list%5Bcontroller%5D=Posts&cHash=13d15edce9ae768be7dd36a140811b82

이 하나의 방법 만 뉴스 항목을 확장하는 나에게 말한다 영어로 튜토리얼을 읽거나, 간단히 설명하면 모든 컨텐트 요소에 선택 가능한 필드를 추가하는 방법을 설명 할 수 있습니다.

답변

1

TypoScript를 사용하여 다음과 같은 작업을 수행 할 수 있습니다.

tt_content.stdWrap.innerWrap.cObject { 
    100 =< tt_content.stdWrap.innerWrap.cObject.default 
    100.20.10.value = module green 

    100 =< tt_content.stdWrap.innerWrap.cObject.default 
    100.20.10.value = module dark 
} 

두 번째를 : 다음 "외관/레이아웃"당신의 주요 TypoScript 설정에서

TCEFORM.tt_content.section_frame { 
    removeItems = 1,5,6,10,11,12,20,21,66 
    addItems { 
     100 = Module Green 
     110 = Module Dark 
    } 
} 

을 통해 선택할 수 있습니다, 당신의 page.ts의 설정이 추가, 당신은 추가해야 HTML에 필요한 클래스 이름을 제공해야합니다.

관련 문제