TYPO3 4.6 包括带有 Typoscript 的 extbase 插件
我有 TYPO3 4.6,在 tempvoila 模板中我有打字稿对象路径 lib.header
并且我想要 将插件的输出重定向到 lib.header
我在 ext_localconf.php 中编写和配置了扩展库和插件,如下所示:
Tx_Extbase_Utility_Extension::configurePlugin(
$_EXTKEY,
'RandomPhotoSlideShow',
array(
'Photo' => 'randomPhotoSlideShow',
),
// non-cacheable actions
array(
'Photo' => ''
)
);
在 ext_tables.php 中如下所示:
Tx_Extbase_Utility_Extension::registerPlugin(
$_EXTKEY,
'RandomPhotoSlideShow',
'Gets random photos for slide show'
);
在 Typoscript 模板中我有这样的:
plugin.tx_gallery.widgets {
papaWidget = USER
papaWidget {
userFunc = tx_extbase_core_bootstrap->run
pluginName = RandomPhotoSlideShow
extensionName = Gallery
controller = Photo
action = randomPhotoSlideShow
switchableControllerActions {
Photo {
1 = randomPhotoSlideShow
}
}
settings =< plugin.tx_gallery.settings
persistence =< plugin.tx_gallery.persistence
view =< plugin.tx_gallery.view
}
}
lib.header < plugin.tx_gallery.widgets.papaWidget
但没有显示任何内容,有人可以建议我在哪里出错或者 extbase 中是否发生了更改1.4 包含在 TYPO3 4.6 中吗?
I have TYPO3 4.6, in tempvoila template i have typoscript object path lib.header
and I want
to redirect output of plugin to lib.header
I have extension Gallery and plugin written and configured in ext_localconf.php like this:
Tx_Extbase_Utility_Extension::configurePlugin(
$_EXTKEY,
'RandomPhotoSlideShow',
array(
'Photo' => 'randomPhotoSlideShow',
),
// non-cacheable actions
array(
'Photo' => ''
)
);
in ext_tables.php like this:
Tx_Extbase_Utility_Extension::registerPlugin(
$_EXTKEY,
'RandomPhotoSlideShow',
'Gets random photos for slide show'
);
and in typoscript template I have this:
plugin.tx_gallery.widgets {
papaWidget = USER
papaWidget {
userFunc = tx_extbase_core_bootstrap->run
pluginName = RandomPhotoSlideShow
extensionName = Gallery
controller = Photo
action = randomPhotoSlideShow
switchableControllerActions {
Photo {
1 = randomPhotoSlideShow
}
}
settings =< plugin.tx_gallery.settings
persistence =< plugin.tx_gallery.persistence
view =< plugin.tx_gallery.view
}
}
lib.header < plugin.tx_gallery.widgets.papaWidget
But nothing is displayed, could someone please advice where I have mistake or if something changed in extbase 1.4 included in TYPO3 4.6?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为问题出在你的行动上。你的控制器中真的有 randomPhotoSlideShowAction 吗?
还要检查指定的pluginName是否正确。
请尝试指定您的索引或列表操作,看看会发生什么。
如果您的操作是正确的,请确保您确实从操作中返回了一些东西!
I think the problem is your action. Do you really have a randomPhotoSlideShowAction in your Controller?
Also check if the specified pluginName is correct.
Please try to specify your index or list Action and see what happens.
If your action is correct, make sure you are actually returning something from your action!
您的代码看起来不错,唯一缺少的是
Controller
部分(根据命名约定)Your code looks good, the only thing missing is the
Controller
part (as per naming convention) in