简体   繁体   English

Fluid的图像ViewHelper显示过时的图像

[英]Fluid's image viewhelper shows outdated images

The following situation: 以下情况:

  • Automated importing of items: 自动导入项目:
    • Images for items are updated by some cron task perl into folder uploads/myExt/<Vendor>/<Serial>/ (Vendor and Serial may differ between products) 项目的图像由某些cron任务perl更新为文件夹uploads/myExt/<Vendor>/<Serial>/ (产品之间的供应商和序列号可能有所不同)
    • Images have naming conventions and every product has its own folder 图片具有命名约定,每个产品都有其自己的文件夹
    • A Command script is started on the command line which get's product data by an XML file; 在命令行上启动命令脚本,该命令脚本通过XML文件获取产品数据。 data is stored in database (Extbase tx_myext_domain_model_item ) 数据存储在数据库中(Extbase tx_myext_domain_model_item
  • Frontend Rendering 前端渲染
    • Extbase controller scans the the item's image folder uploads/myExt/<Vendor>/<Serial>/ and sends an array of filenames (name: imagesInFolder ) in that folder along with the name of the folder (name: imageFolder ) to the template Extbase控制器扫描项目的图像文件夹uploads/myExt/<Vendor>/<Serial>/并将该文件夹中的文件名数组(名称: imagesInFolder )以及文件夹名称(名称: imageFolder )发送到模板
    • Fluid template loops over the imagesInFolder : <f:for each="{imagesInFolder}" as="image"> 流体模板在imagesInFolder循环: <f:for each="{imagesInFolder}" as="image">
    • For every image render a thumbnail of the image with the help of Fluid's image view helper: <f:image src="{item.imageFolder -> f:format.raw()}/{image}" maxWidth="193" maxHeight="145" /> 对于每个图像,请使用Fluid的image视图帮助器渲染图像的缩略图: <f:image src="{item.imageFolder -> f:format.raw()}/{image}" maxWidth="193" maxHeight="145" />

Here's the issue: 这是问题所在:

When the order of the files is changed, only the filenames are changed. 更改文件顺序时,仅更改文件名。 but in the frontend the order remains the same as before, which is wrong. 但在前端的顺序与以前相同,这是错误的。 The processed thumbnails in the _processed_ folder are not updated. _processed_文件夹中的已处理缩略图不会更新。 I have tried to change the mtime and ctime of the files to be newer than that of the processed files, but nothing has changed. 我试图将文件的mtime和ctime更改为比已处理文件的更新,但没有任何更改。

How can I tell TYPO3 to re-render processed files when original file is newer? 当原始文件较新时,如何告诉TYPO3重新渲染处理过的文件?

Maybe there is some TypoScript setting for Fluid that does this which I didn't find. 也许我没有找到一些Fluid的TypoScript设置来做到这一点。
Maybe there is some Service which I could call during import? 也许有一些我可以在导入期间致电的服务?

There is a scheduler task named "File Abstraction Layer: Update storage index" which scans a file storage for new or changed files. 有一个名为“文件抽象层:更新存储索引”的调度程序任务,该任务扫描文件存储中的新文件或更改的文件。

Make sure the task starts often enough. 确保任务启动足够频繁。

In general: try to avoid replacing or renaming files as TYPO3 generates dependent files and records, which all need refreshing. 通常:尝试避免替换或重命名文件,因为TYPO3会生成依赖文件和记录,这些文件和记录都需要刷新。

be aware there is another similar task: "File Abstraction Layer: Extract metadata in storage" , which might need to be called after the other. 请注意,还有另一个类似的任务: “文件抽象层:提取存储中的元数据” ,可能需要在另一个之后调用它。

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

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