[英]piBased Plugin (FLUID) - Image Problems with TYPO3 6.2
I still use piBased-Plugins in my updated TYPO3 v6.2.7 - Installation. 我仍在更新后的TYPO3 v6.2.7-安装中使用piBased-Plugins。 Since 6.2., I have some problems with my small Frontend-Plugin.
从6.2。开始,我的小型Front-Plugin遇到了一些问题。
My Plugin only show a headline, link and an image. 我的插件仅显示标题,链接和图像。 If there is no Image selected in Backend, my plugin doesn't show the HTML-Output in Frontend:
如果在后端没有选择图像,那么我的插件不会在前端显示HTML输出:
<f:if condition="{imgTeaser}">
<f:image src="{imgTeaser}" alt="" />
</f:if>
But now I get an error. 但是现在我得到一个错误。 If I upload an image everything was fine.
如果我上传图片,一切都很好。 But without an image, i 'll get these Error warnings in Backend and Frontend.
但是如果没有图像,我将在后端和前端收到这些错误警告。
HOW CAN I UPDATE MY piBASED-PLUGIN (FLEXFORM)? 我如何更新我的piBASED-PLUGIN(FLEXFORM)? There must be a problem with the images or path-to-image.
图像或图像路径必定有问题。 I'm not a PHP-Programmer, so I have no idea .. ;)
我不是PHP程序员,所以我不知道..;)
"Supplied file object type TYPO3\\CMS\\Core\\Resource\\Folder must be File or FileReference." “提供的文件对象类型TYPO3 \\ CMS \\ Core \\ Resource \\ Folder必须是File或FileReference。”
Thanks for your help! 谢谢你的帮助! Stef
斯蒂夫
-- -
Deprication Log: 贬值日志:
|The way registering a wizard in TCA has changed in 6.2.
|在TCA中注册向导的方式在6.2中已更改。 Please set module[name]=module_name instead of using script=path/to/sctipt.php in your TCA.
请在TCA中设置module [name] = module_name,而不要使用script = path / to / sctipt.php。 The possibility to register wizards this way will be removed in 2 versions.|
以这种方式注册向导的可能性将在2个版本中被删除。
Frontend Error: 前端错误:
Supplied file object type TYPO3\CMS\Core\Resource\Folder must be File or FileReference.
and 和
09-12-14 10:56:
09-12-14 10:56:
|TYPO3\\CMS\\Core\\Utility\\GeneralUtility::loadTCA() - since 6.1, will be removed two versions later - require(typo3/sysext/cms/tslib/index_ts.php),index.php#28 // TYPO3\\CMS\\Core\\Core\\Bootstrap->loadExtensionTables#123 // TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::loadExtTables#925 // TYPO3\\CMS\\Core\\Cache\\Frontend\\PhpFrontend->requireOnce#1729 // TYPO3\\CMS\\Core\\Cache\\Backend\\SimpleFileBackend->requireOnce#72 // require_once(typo3temp/Cache/Code/cache_core/ext_tables_8daea175f152090331d107ba834640863df1679e.php),typo3/sysext/core/Classes/Cache/Backend/SimpleFileBackend.php#364 // TYPO3\\CMS\\Core\\Utility\\GeneralUtility::loadTCA#3183 // TYPO3\\CMS\\Core\\Utility\\GeneralUtility::logDeprecatedFunction#4167 (typo3/sysext/core/Classes/Utility/GeneralUtility.php#4165)|
| TYPO3 \\ CMS \\ Core \\ Utility \\ GeneralUtility :: loadTCA()-从6.1开始,将在以后的两个版本中删除-require(typo3 / sysext / cms / tslib / index_ts.php),index.php#28 // TYPO3 \\ CMS \\ Core \\ Core \\ Bootstrap-> loadExtensionTables#123 // TYPO3 \\ CMS \\ Core \\ Utility \\ ExtensionManagementUtility :: loadExtTables#925 // TYPO3 \\ CMS \\ Core \\ Cache \\ Frontend \\ PhpFrontend-> requireOnce#1729 // TYPO3 \\ CMS \\ Core \\ Cache \\ Backend \\ SimpleFileBackend-> requireOnce#72 // // require_once(typo3temp / Cache / Code / cache_core / ext_tables_8daea175f152090331d107ba834640863df1679e.php),typo3 / sysext / core / Classes / Cache / Backend / SimpleFileBackend.php#364 TYPO3 \\ CMS \\ Core \\ Utility \\ GeneralUtility :: loadTCA#3183 // TYPO3 \\ CMS \\ Core \\ Utility \\ GeneralUtility :: logDeprecatedFunction#4167(typo3 / sysext / core / Classes / Utility / GeneralUtility.php#4165)|
I use a flexform to upload my images from the Plugin to the /uploads-Folder like this: 我使用flexform将图片从插件上传到/ uploads-Folder,如下所示:
<image>
<TCEforms>
<label>LLL:EXT:my_modules/pi3/locallang_flex.xml:label.imgTeaser</label>
<config>
<type>group</type>
<internal_type>file</internal_type>
<allowed>jpg,png,gif</allowed>
<max_size>500000</max_size>
<uploadfolder>uploads/tx_mymodules/</uploadfolder>
<size>1</size>
<maxitems>1</maxitems>
<minitems>0</minitems>
<show_thumbs>1</show_thumbs>
</config>
</TCEforms>
</image>
PHP-class: PHP类:
class tx_mymodules_pi3 extends tslib_pibase {
...
var $imagePath = 'uploads/tx_mymodules/';
...
public function main($content, array $conf) {
$image = $this-> imagePath . $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'image', 'basicsheet');
...
$this->view->assign('imgTeaser', $image);
...
return ($content);
}
}
my FLUID Template was wrong. 我的流体模板错误。 But I don't know why?!
但是我不知道为什么?
Was: 是:
<f:if condition="{imgTeaser}">
<f:image src="{imgTeaser}" alt="" />
</f:if>
Now: 现在:
<f:if condition="{imgTeaser}">
<f:image src="uploads/tx_mymodules/{imgTeaser}" alt="" />
</f:if>
And in my PHP CLass: 在我的PHP CLass中:
var $imagePath = 'uploads/tx_mymodules/';
public function main($content, array $conf) {
...
$image = $this-> imagePath . $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'image', 'basicsheet');
...
}
Change To: 改成:
public function main($content, array $conf) {
...
$image = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'image', 'basicsheet');
...
}
Now it works! 现在可以了! Maybe someone can explain it ... Thx
也许有人可以解释一下... Thx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.