Reputation: 9713
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.
Upvotes: 1
Views: 5590
Reputation: 3229
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:
TypoScript
see also Configuration Overview in "TYPO3 Explained"
Also,
Upvotes: 0
Reputation: 1819
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!
Upvotes: 1
Reputation: 9713
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
Upvotes: 3