简体   繁体   中英

How to add more frame layout to Typo3 backend

I currently want users to select layout for their content whenever they add them. For example, they may want their content as newsletter layout or content that have border on top.

To do this, I first add some items for section frame in my typoscript file:

TCEFORM.tt_content.section_frame {
  disabled = 0
  removeItems = 1,5,6,10,11,12,20,21,66
  addItems.104 = Newsletter
  addItems.105 = Country
  addItems.106 = Social
  addItems.107 = Border Top
}

Then I include it in the typoscript on the resource tab of my root page property:

<INCLUDE_TYPOSCRIPT: source="FILE: fileadmin/typoscript/tsconfig/page/minimal_rte.ts">

Then I add some typoscript below it:

tt_content.stdWrap.innerWrap.cObject {
    104 < tt_content.stdWrap.innerWrap.cObject.default
    104 = TEXT
    104.value = <div class="newsletter">|</div>

    105 < tt_content.stdWrap.innerWrap.cObject.default
    105 = TEXT
    105.value = <div class="country">|</div>

    106 < tt_content.stdWrap.innerWrap.cObject.default
    106 = TEXT
    106.value = <div class="social">|</div>

    107 < tt_content.stdWrap.innerWrap.cObject.default
    107 = TEXT
    107.value = <div class="border_top">|</div>
}

However, I could see those layout show successfully in my backend page. But whenever I select them, they don't apply those classes at all.

I'm not sure if the steps above are correct or there are some more configurations to implement.

Any idea would be appreciated.

This task is already been solved. According to http://float-middle.blogspot.com/2009/07/custom-frames-for-content-elements-in.html . I add the typoscript:

tt_content.stdWrap.innerWrap.cObject {
  104 < tt_content.stdWrap.innerWrap.cObject.default
  104 = TEXT
  104.value = <div class="newsletter">|</div>

  105 < tt_content.stdWrap.innerWrap.cObject.default
  105 = TEXT
  105.value = <div class="country">|</div>

  106 < tt_content.stdWrap.innerWrap.cObject.default
  106 = TEXT
  106.value = <div class="social">|</div>

  107 < tt_content.stdWrap.innerWrap.cObject.default
  107 = TEXT
  107.value = <div class="border_top">|</div>
}

in the wrong place. I need to add it in the set up section

In TSConfig

# add new frame to content element
TCEFORM.tt_content.section_frame {
  disabled = 0
  removeItems = 1,5,6,10,11,12,20,21,66
  addItems.101 = Leading style
}

In set.txt

tt_content.stdWrap.innerWrap.cObject = CASE
tt_content.stdWrap.innerWrap.cObject {
    key.field = section_frame
    101 = TEXT
    101.value = <div class="lead">|</div>
}

Hope it works!

In addition to everything else, I think you are mixing up TSconfig and TypoScript.

TCEFORM.tt_content.section_frame

is TSConfig

tt_content.stdWrap.innerWrap.cObject

is TypoScript

TSconfig:

  • set in Backend in Page Properties > Resources > TSconfig
  • or, set in Extension, for example with \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::addPageTSConfig
  • view in Backend: Info > Page TSconfig
  • documentation: how to config
  • settings documented in TSconfig Reference

TypoScript

  • set in Backend: Template > Info/Modify > Setup
  • or, set in Extension for example with \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::addStaticFile() (to be includedas static include
  • view in Backend: Template > TypoScript Object Browser
  • documentation: how to config
  • documented in TypoScript reference

see also Configuration Overview in "TYPO3 Explained"


Also,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM