[TYPO3-templavoila] additional field in FCE
ronslists at busynoggin.com
Mon Jul 25 19:46:22 CEST 2011
At some point I may add a field for the user to type in a CSS class: however, I am not committed to that yet.
However, there is a way to accomplish what you wish without touching the DS. Use the "section frame" field of the CE field to set up your choices. If you do not need the default "Frame 1" entry then you could do something like this:
TCEFORM.tt_content.section_frame.altLabels.20 = My Special Layout
Then adjust the TS so that a div with your class is wrapped around the entire FCE. Look at the rendering for the default values of section_frame for guidance. If you are just adjusting the "20" value as in my previous example then it would be something like this:
tt_content.stdWrap.innerWrap.cObject.20.15.value = csc-frame my-special-class
This will give you a class on a div that surrounds the entire FCE which you can use to target the FCE. And the Framework code does not need to be touched and updates will not break it.
Now this assumes that all you need is get a CSS class in there for adjusting styling but do not need to adjust the containerWidth register value that the framework uses to track the current width available. If you need to adjust that as well, then you will need to rewrite the rendering in the local processing of the template object. Or you can copy the DS as the basis of new custom FCE. But in ether case an understanding of how calculate and reset those container widths will be required.
On Jul 25, 2011, at 11:26 AM, Thomas Gabler wrote:
> Hello Ron,
>> In this instance, I do not believe you want to follow the approach Kay gave. This would change the DS within the extension which would be blown out again on the next update of the extension. It is the way to do it normally but not when the DS is in an extension.
>> If you truly need a new field then you can copy the DS and treat it as a separate DS/FCE and located where you would normally put them.
>> Changing the rendering of the TS is not a big issue as local processing can be used to override the default rendering of the framework.
>> But let me know what you need the field for and for which FCEs as there might be other ways to approach it.
> I need an additional field for selection for the single module (see my first try below).
> The class for module body should be extended similar to class moduleBodyBleed.
> moduleBodyClass1 = moduleBody moduleBodyBleed moduleBodyLayout<selected value>
> <field_module_1_layout type="array">
> <tx_templavoila type="array">
> <sample_data type="array">
> <numIndex index="0"></numIndex>
> <TCEforms type="array">
> <config type="array">
> <items type="array">
> <numIndex index="0" type="array">
> <numIndex index="0">Layout 1</numIndex>
> <numIndex index="1">0</numIndex>
> <numIndex index="1" type="array">
> <numIndex index="0">Layout 2</numIndex>
> <numIndex index="1">1</numIndex>
> <numIndex index="3" type="array">
> <numIndex index="0">Layout 3</numIndex>
> <numIndex index="1">2</numIndex>
> Thanks a lot,
> TYPO3-project-templavoila mailing list
> TYPO3-project-templavoila at lists.typo3.org
More information about the TYPO3-project-templavoila