[TYPO3-dev] New field for "page" with kickstarter extension to be translateable

Adrian Marte am at break-media.com
Mon Oct 7 11:59:13 CEST 2013


Dear Dev-List!

I'm trying to create a new field in table page to be used in Menu and to
be translatable.
This works great, but in menu the translation is not there. For every
language just
base language is shown. Every other content on the page is translated
fine.

Any hints?
Thanks in advance, 
Adrian

This is the TS i use for displaying my new field in menu.
So currently tx_inteosnavigationfield_subtitle_navigation is shown, but
not translated. 
"subtitle" is translated fine.


lib.mainMenu.2 = TMENU
lib.mainMenu.2 < lib.mainMenu.1
lib.mainMenu.2.expAll = 1
lib.mainMenu.2.wrap = <ul class="ml-2">|</ul>
lib.mainMenu.2.NO {
	wrapItemAndSub = 
	linkWrap = <li> | </li>
	stdWrap.cObject = COA
	stdWrap.cObject {
	  allWrap = 
	  10 = TEXT       
	  10.field = nav_title
	  10.wrap = <span class="title"> | </span>
	  20 = TEXT
	  # 20.field = subtitle
	  20.field = tx_inteosnavigationfield_subtitle_navigation // subtitle
	  20.wrap = <span class="subtitle"> | </span><div class="clearer"></div>
	}
}



This is my extension:

README.txt
Feel free to add some documentation or simply add a link to the online manual.
ext_tables.php
<?php
if (!defined ('TYPO3_MODE')) {
    die ('Access denied.');
}
$tempColumns = array (
    'tx_inteosnavigationfield_subtitle_navigation' => array (        
        'exclude' => 0,        
        'label' => 'LLL:EXT:inteos_navigation_field/locallang_db.xml:pages.tx_inteosnavigationfield_subtitle_navigation',        
        'config' => array (
            'type' => 'input',    
            'size' => '30',
        )
    ),
);


t3lib_div::loadTCA('pages');
t3lib_extMgm::addTCAcolumns('pages',$tempColumns,1);
t3lib_extMgm::addToAllTCAtypes('pages','tx_inteosnavigationfield_subtitle_navigation;;;;1-1-1');

$tempColumns = array (
    'tx_inteosnavigationfield_subtitle_navigation' => array (        
        'exclude' => 0,        
        'label' => 'LLL:EXT:inteos_navigation_field/locallang_db.xml:pages_language_overlay.tx_inteosnavigationfield_subtitle_navigation',        
        'config' => array (
            'type' => 'input',    
            'size' => '30',
        )
    ),
);


t3lib_div::loadTCA('pages_language_overlay');
t3lib_extMgm::addTCAcolumns('pages_language_overlay',$tempColumns,1);
t3lib_extMgm::addToAllTCAtypes('pages_language_overlay','tx_inteosnavigationfield_subtitle_navigation;;;;1-1-1');
?>
ext_tables.sql
#
# Table structure for table 'pages'
#
CREATE TABLE pages (
    tx_inteosnavigationfield_subtitle_navigation tinytext
);



#
# Table structure for table 'pages_language_overlay'
#
CREATE TABLE pages_language_overlay (
    tx_inteosnavigationfield_subtitle_navigation tinytext
);
locallang_db.xml
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
    <meta type="array">
        <type>database</type>
        <description>Language labels for database tables/fields belonging to extension 'inteos_navigation_field'</description>
    </meta>
    <data type="array">
        <languageKey index="default" type="array">
            <label index="pages.tx_inteosnavigationfield_subtitle_navigation">Subtitle Navigation</label>
            <label index="pages_language_overlay.tx_inteosnavigationfield_subtitle_navigation">Subtitle Navigation</label>
        </languageKey>
    </data>
</T3locallang>



More information about the TYPO3-dev mailing list