[英]TYPO3 4.6 include extbase plugin with typoscript
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: 我有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' => ''
)
);
in ext_tables.php like this: 在ext_tables.php中是这样的:
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? 但是什么都没有显示,有人可以建议我哪里出错了,或者TYPO3 4.6中包含的extbase 1.4中有什么更改吗?
I think the problem is your action. 我认为问题出在你的行动上。 Do you really have a randomPhotoSlideShowAction in your Controller? 您的控制器中确实有一个randomPhotoSlideShowAction吗? Also check if the specified pluginName is correct. 还要检查指定的pluginName是否正确。
Please try to specify your index or list Action and see what happens. 请尝试指定索引或列出操作,然后看看会发生什么。
action = index
switchableControllerActions {
Photo {
1 = index
}
}
If your action is correct, make sure you are actually returning something from your action! 如果您的操作正确,请确保您实际上从操作中返回了一些东西!
public function randomPhotoSlideShowAction(...) {
// [...]
$this->view->assign('foo', 'bar');
return $this->view->render();
}
您的代码看起来不错,唯一缺少的是Controller
部分(按照命名约定)
controller = PhotoController
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.