Please help,
I created an extension with the Builder Extension. In the extension I included a simple fluid page template.
Then I added a custom page setup field as described in this post.
(1.add DB-Field in ext_tables.sql; 2. add TCA definition in extTables.php)
Unfortunately no field appears. I tried the proposed way (ext_tables.sql):
$tmp_itm_extended_columns_pages = array(
'customTemplateClass' => array(
'exclude' => 0,.....
as well as the version from realurl:
$TCA['pages']['columns'] += array(
'customTemplateClass' => array(
'label' => 'customTemplateClass'...
Don't know how to get that custom page setup running. Is there a problem combinig it with fluid page templates?
Thanks for help Mathias
Add custom text field for page configuration within an extension. Here is how I implemented a custom field within my fluid template extension, ready for page level sliding:
1.) Define custom text field: myExt/ext_tables.php
$TCA['pages']['columns'] += array(
'customTemplateClass' => array(
'label' => 'Custom Template Class',
'exclude' => 1,
'config' => array (
'type' => 'input',
'max' => 255,
'eval' => 'trim,nospace,lower'
),
),
);
2.) Add the field to the TCA type configuration: myExt/ext_tables.php
t3lib_extMgm::addToAllTCAtypes (
'pages',
'customTemplateClass'
);
3.) Write custom field to database: myExt/ext_tables.sql
CREATE TABLE pages (
customTemplateClass varchar(255) DEFAULT '' NOT NULL
);
4.) Add custom field to rootlinefields for page level sliding: myExt/ext_localconf.php
$rootlinefields = &$GLOBALS["TYPO3_CONF_VARS"]["FE"]["addRootLineFields"];
if($rootlinefields != '')
{
$rootlinefields .= ' , ';
}
$rootlinefields .= 'customTemplateClass';
5.) Get the custom class of current page or if empty of the parent page: TypoScript:
lib.pageconfig {
customTemplateClass = TEXT
customTemplateClass {
value = default
override {
required = 1
data = levelfield : -1 , customTemplateClass, slide
}
}
}
6.) Output in Fluid-Template file:
{f:cObject(typoscriptObjectPath: 'lib.pageconfig.customTemplateClass')}
You need to add the field to the TCA type configuration for the table "pages" where it should show up. There is a utility method for adding it to all configured types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With