在扩展扩展名tx_news时,我遇到了有关消失内容的相同问题。我用一些复选框扩展了新闻扩展名,但是这些值在一段时间(2小时)后丢失。如果我刷新系统缓存,则复选框值再次正确,但过了一段时间后消失了。我在9.5.5版本中遇到了这个问题,但是从我的角度来看,我所做的一切都正确。为什么有时内容会消失?
/**
* News model for default news
*
* @package TYPO3
* @subpackage tx_news
*/
class NewsExtend extends \GeorgRinger\News\Domain\Model\News {
/**
* imageGalleryDownload
*
* @var bool
*/
protected $imageGalleryDownload = false;
/**
* Returns the imageGalleryDownload
*
* @return bool $imageGalleryDownload
*/
public function getImageGalleryDownload()
{
return $this->imageGalleryDownload;
}
/**
* Sets the imageGalleryDownload
*
* @param bool $imageGalleryDownload
* @return void
*/
public function setImageGalleryDownload($imageGalleryDownload)
{
$this->imageGalleryDownload = $imageGalleryDownload;
}
/**
* Returns the boolean state of imageGalleryDownload
*
* @return bool
*/
public function isImageGalleryDownload()
{
return $this->imageGalleryDownload;
}
}
在我的TCA中:
'image_gallery_download' => [
'exclude' => false,
'l10n_mode' => 'prefixLangTitle',
'label' => 'Disable Image-Download function',
'config' => [
'type' => 'check',
'items' => [
'1' => [
'0' => 'Disabled'
]
],
'default' => 0,
],
],
答案 0 :(得分:0)
请在下面查看我的信息:
<f:section name="imageGallery">
<div class="newsSiteHeader">
<f:cObject typoscriptObjectPath="lib.imageGallery" />
</div>
<div class="news-img-gallery imageGallery" data-allowdownload="{f:if(condition: '{imageGalleryDownload} > 0', then: '0', else: '1')}">
<div class="row">
<f:for each="{media}" as="mediaElement" iteration="iteration">
<div class="col-4 col-md-3 col-lg-4 pt-0 pr-2 pb-3 pl-2">
<div class="mediaelement mediaelement-image">
<f:if condition="{settings.detail.media.image.lightbox.enabled}">
<f:then>
<a href="{f:uri.image(image:mediaElement, width:'{settings.detail.media.image.lightbox.width}', height:'{settings.detail.media.image.lightbox.height}')}" title="{mediaElement.title}" class="{settings.detail.media.image.lightbox.class}" rel="{settings.detail.media.image.lightbox.rel}">
<f:media file="{mediaElement}" title="{mediaElement.title}" alt="{mediaElement.alternative}" width="115c" height="115c" additionalAttributes="{data-originalfile: '{mediaElement.originalResource.originalFile.publicUrl}', data-figcaption: '{mediaElement.description}'}" />
</a>
</f:then>
<f:else>
<f:media file="{mediaElement}" title="{mediaElement.title}" width="115c" height="115c" alt="{mediaElement.alternative}" width="115c" height="115c"/>
</f:else>
</f:if>
</div>
<f:if condition="{mediaElement.description}">
<p class="news-img-caption">
{mediaElement.description}
</p>
</f:if>
</div>
</f:for>
</div>
</div>
</f:section>