0

I have extended tx-news with a custom date-field and want to sort the list view by this field. Accordding to the documentation I have extended the "Sort by"-Selectbox of the news-plugin an everything works fine:

$GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['orderByNews'] .= ',my_field';

plugin.tx_news.settings.orderByAllowed := addToList(my_field)

But how can I translate or customize the label of the option in the selectbox? Currently it shows the name of the field?

m4a
  • 131
  • 1
  • 9
  • From which table do you read the properties? – Aristeidis Karavas May 08 '19 at 12:55
  • I have extended the table tx_news_domain_model_news with my own field. – m4a May 08 '19 at 12:58
  • Do you have an override folder (TCA)? – Aristeidis Karavas May 08 '19 at 13:00
  • Yes I have Configuration/TCA/Overrides/tx_news_domain_model_news.php in which I define my field. In the backend form of the records in list module I get the Labels from there, but not in the plugin. – m4a May 08 '19 at 13:02
  • $GLOBALS[‘TCA’][‘tx_news_domain_model_news’][‘my_field’][‘label’] = Try this and adjust the path to the right target – Aristeidis Karavas May 08 '19 at 13:07
  • does not change anything. Why should I do this twice? I have the following in my override: ```$tempColumns = Array( 'my_field' => array ( 'label' => 'LLL:EXT:....', 'config' => array(....), ), ), \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns("tx_news_domain_model_news", $tempColumns);``` I would guess, this does the same as ```$GLOBALS[‘TCA’][‘tx_news_domain_model_news’][‘my_field’][‘label’] = ...```, or not? – m4a May 08 '19 at 13:23
  • My bad I didn’t that read the question carefully. Do You want the options to be translated? – Aristeidis Karavas May 08 '19 at 13:25
  • Right, translate or set a custom label name. Now I get only the field name as label. I thouht, I would get the label from my TCA override in the plugin options too. – m4a May 08 '19 at 13:27
  • Can you post the options code on your question? – Aristeidis Karavas May 08 '19 at 13:29
  • I did the two lines of code, which I wrote in my question. This results in the following piece of html in the backend:
    – m4a May 08 '19 at 13:35

0 Answers0