0

I run into the same problem regarding disappeared content when extending the extension tx_news. I extend the news extension with some chekboxes, but these values are lost after some time (2 hours). If I FLush the system cache, the checkbox value is correct again, but is gone after some time again. I had this issue with the 9.5.5 version, but from my point of view I have done everything correct. Why does the content disappears sometimes?

/**
* 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;
}

}

And at my TCA:

'image_gallery_download' => [
      'exclude' => false,
      'l10n_mode' => 'prefixLangTitle',
      'label' => 'Disable Image-Download function',
      'config' => [
          'type' => 'check',
          'items' => [
              '1' => [
                  '0' => 'Disabled'
              ]
            ],
          'default' => 0,
        ],
  ],
jokumer
  • 2,249
  • 11
  • 22
WimDiesel
  • 65
  • 1
  • 9

1 Answers1

0

Please see my fluid below:

<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>
WimDiesel
  • 65
  • 1
  • 9