我正在尝试将 Javascript 文件添加到公司为我构建的 Typo3 插件中。
现在包含文件 main.js(/public_html/typo3conf/etc/intranetapi/Resources/Public/Javascript/main.js)。我一直在搜索代码,发现以下内容:
public_html/typo3conf/etc/intranetapi/Configuration/TypoScript/contants.txt
plugin.tx_intranetapi {
settings {
js {
# cat=plugin.tx_intranetapi_js/javascript; type=string; label=Javascript file 1
file1 = EXT:intranetapi/Resources/Public/Javascript/main.js
}
}
}
public_html/typo3conf/etc/intranetapi/Configuration/TypoScript/setup.txt
plugin.tx_intranetapi {
settings {
js {
file1 = {$plugin.intranetapi.settings.js.file1}
}
}
}
page.includeJSFooterlibs.intranetapi = {$plugin.tx_intranetapi.settings.js.file1}
文件 main.js 以应有的方式包含在内,但现在我想添加另一个名为 intranetApi.js 的 javascript 文件。
我想我可以这样做: public_html/typo3conf/etc/intranetapi/Configuration/TypoScript/contants.txt
plugin.tx_intranetapi {
settings {
js {
# cat=plugin.tx_intranetapi_js/javascript; type=string; label=Javascript file 1
file1 = EXT:intranetapi/Resources/Public/Javascript/main.js
# cat=plugin.tx_intranetapi_js/javascript; type=string; label=Javascript file 2
file1 = EXT:intranetapi/Resources/Public/Javascript/intranetApi.js
}
}
}
public_html/typo3conf/etc/intranetapi/Configuration/TypoScript/setup.txt
plugin.tx_intranetapi {
settings {
js {
file1 = {$plugin.intranetapi.settings.js.file1}
file2 = {$plugin.intranetapi.settings.js.file2}
}
}
}
page.includeJSFooterlibs.intranetapi = {$plugin.tx_intranetapi.settings.js.file1}
page.includeJSFooterlibs.intranetapi = {$plugin.tx_intranetapi.settings.js.file2}
在上面的代码更改后,我通过单击页面顶部的闪电图标清除了所有 Typo3 缓存。但不幸的是,它不起作用。
我个人认为这与 page.includeJSFooterlibs.intranetapi = {$plugin.tx_intranetapi.settings.js.file2} 我认为覆盖旧配置有关。我也试过page.includeJSFooterlibs.intranetapi = {$plugin.tx_intranetapi.settings.js.file1, $plugin.tx_intranetapi.settings.js.file2}
了,但这也不起作用......
我对 Typo3 很陌生,我找不到有关此类问题的任何其他信息。帮助将不胜感激!