繁体   English   中英

piBased插件(FLUID)-TYPO3 6.2的图像问题

[英]piBased Plugin (FLUID) - Image Problems with TYPO3 6.2

我仍在更新后的TYPO3 v6.2.7-安装中使用piBased-Plugins。 从6.2。开始,我的小型Front-Plugin遇到了一些问题。

我的插件仅显示标题,链接和图像。 如果在后端没有选择图像,那么我的插件不会在前端显示HTML输出:

<f:if condition="{imgTeaser}">
  <f:image src="{imgTeaser}" alt="" />
</f:if>

但是现在我得到一个错误。 如果我上传图片,一切都很好。 但是如果没有图像,我将在后端和前端收到这些错误警告。

我如何更新我的piBASED-PLUGIN(FLEXFORM)? 图像或图像路径必定有问题。 我不是PHP程序员,所以我不知道..;)

“提供的文件对象类型TYPO3 \\ CMS \\ Core \\ Resource \\ Folder必须是File或FileReference。”

谢谢你的帮助! 斯蒂夫

-

贬值日志:

|在TCA中注册向导的方式在6.2中已更改。 请在TCA中设置module [name] = module_name,而不要使用script = path / to / sctipt.php。 以这种方式注册向导的可能性将在2个版本中被删除。

前端错误:

Supplied file object type TYPO3\CMS\Core\Resource\Folder must be File or FileReference.

09-12-14 10:56:

| 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)|

我使用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 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);
  }
}

我的流体模板错误。 但是我不知道为什么?

是:

<f:if condition="{imgTeaser}">
  <f:image src="{imgTeaser}" alt="" />
</f:if>

现在:

<f:if condition="{imgTeaser}">
  <f:image src="uploads/tx_mymodules/{imgTeaser}" alt="" />
</f:if>

在我的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');
  ...
}

改成:

public function main($content, array $conf) {
  ...
  $image = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'image', 'basicsheet');
  ...
}

现在可以了! 也许有人可以解释一下... Thx

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM