【发布时间】:2016-10-02 20:47:08
【问题描述】:
我在 Typo3 6.2 中使用扩展生成器、extbase 和流体进行了扩展。
我想在前端添加一个时间选择器。
我在网上找到了一个 .js 文件,并且想在扩展程序处于活动状态时包含它,因为我经常需要它。
我把那个文件放在这里:EXT:/Resources/Public/JS/timepicker.js。
我在this 文章中看到了一个解决方案,但添加了
page.includeJS.tx_myExtension = EXT:/Resources/Public/JS/timepicker.js
在我的 setup.txt 底部不起作用。
我并没有在那里定义page,所以我认为这可能是原因,但我真的不知道 - 这是我在 /typo3conf/ext//Configuration/ 中的 setup.txt(自动生成)排版/:
plugin.tx_myext_test {
view {
templateRootPath = {$plugin.tx_myext_test.view.templateRootPath}
partialRootPath = {$plugin.tx_myext_test.view.partialRootPath}
layoutRootPath = {$plugin.tx_myext_test.view.layoutRootPath}
}
persistence {
storagePid = {$plugin.tx_myext_test.persistence.storagePid}
}
}
最终,我希望我的前端函数能够与 datepicker 一起工作,因为我在根模板中包含了 jQuery。但我不想在其中包含时间选择器,只是为了我的扩展。
<script>
$(function () {
$('.lc-datepicker').datepicker();
$('.lc-timepicker').timepicker();
});
</script>
【问题讨论】:
标签: javascript jquery typo3 typoscript extbase