我正在尝试向td_calendar
扩展名添加新字段。我在Kickstarter中创建了新的扩展并添加了额外的字段。现在我正在尝试使用marker
方法显示现场表格中的数据。
当我插入此代码时:
$markerArray['###ADDITIONAL_LINK###'] = $row['tx_tdcallendaradditionalfield_additional_link'] ? $this->cObj->wrap($this->makeLink($row['tx_tdcallendaradditionalfield_additional_link']), $this->conf['itemLinkWrap']) : '';
在tx_tdcalendar_pi1_singleView.php
文件中的###ADDITIONAL_LINK###
和tmpl
标记,一切正常(附加链接显示在网站上),但我想做得对,所以我创建了两个新的我的扩展文件夹中的文件:
ext_localconf.php
class.tx_tdcallendaradditionalfield_additional_link.php
在ext_localconf.php
我插入这段代码:
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['td_calendar']['extraItemMarkerHook'][] = 'EXT:td_callendar_additional_field/class.tx_tdcallendaradditionalfield_additional_link.php:tx_tdcallendaradditionalfield_additional_link';
?>
在class.tx_tdcallendaradditionalfield_additional_link.php
此代码:
<?php
class tx_tdcallendaradditionalfield_additional_link {
function buildSingleOutput($row){
$SingleViewT = $this->cObj->getSubpart($this->templateCode, '###SINGLE_VIEW###');
$markerArray = array(); // Simple markers
$markerArray['###ADDITIONAL_LINK###'] = $row['tx_tdcallendaradditionalfield_additional_link'] ? $this->cObj->wrap($this->makeLink($row['tx_tdcallendaradditionalfield_additional_link']), $this->conf['itemLinkWrap']) : '';
return $this->cObj->substituteMarkerArrayCached($SingleViewT, $markerArray, $subpartsArray);
}
}
?>
但它没有用。我做错了什么?