findByFromStartToEnd

public function findByFromStartToEnd() {
	$query = $this->createQuery();
	$constraints = null;
	$constraints[] =  $query->equals('hidden', 0);
	$constraints[] =  $query->equals('deleted', 0);
	$constraints[] =  $query->lessThanOrEqual('start_date', date('Y-m-d'));
	$constraints[] =  $query->greaterThanOrEqual('end_date', date('Y-m-d'));
	return $query->matching(
		$query->logicalAnd( $constraints)
	)->execute();
}

f:widget.paginate – Suchparameter übergeben

addQueryStringMethod: ‚POST,GET‘

<f:widget.paginate objects="{DomainObjs}" as="paginatedDomainObjs" configuration="{itemsPerPage: 1, insertAbove: 1, insertBelow: 0, maximumNumberOfLinks: 5, addQueryStringMethod: 'POST,GET'}">

addQueryString=“1″

<f:link.action action="show" arguments="{DomainObj : DomainObj}" addQueryString="1"> 

Edit tt_content in Frontend

https://github.com/wallpageNET/infochy_feeditexample

config.tx_extbase {
    persistence{
        enableAutomaticCacheClearing = 1
        updateReferenceIndex = 0
        classes {
            Infochy\InfochyContent\Domain\Model\Content {
                mapping {
                    tableName = tt_content
                    columns {
                        uid.mapOnProperty = uid
                        pid.mapOnProperty = pid
                        sorting.mapOnProperty = sorting
                        CType.mapOnProperty = contentType
                        header.mapOnProperty = header
                        bodytext.mapOnProperty = bodytext
                    }
                }
            }
        }
    }
}
class Content extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
   /**
    * uid
    *
    * @var string
    */
   protected $uid = '';

   /**
    * pid
    *
    * @var string
    */
   protected $pid = '';

   /**
    * header
    *
    * @var string
    */
   protected $header = '';

   /**
    * sorting
    *
    * @var string
    */
   protected $sorting = '';

   /**
    * contentType
    *
    * @var string
    */
   protected $contentType = '';

   /**
    * Gets the uid
    *
    * @return string $uid
    */
   public function getUid() {
      return $this->uid;
   }
   /**
    * Gets the pid
    *
    * @return string $pid
    */
   public function getPid() {
      return $this->pid;
   }

   /**
    * Returns the header
    *
    * @return string $header
    */
   public function getHeader() {
      return $this->header;
   }

   /**
    * Sets the header
    *
    * @param string $header
    * @return void
    */
   public function setHeader($header) {
      $this->header = $header;
   }

   /**
    * Returns the sorting
    *
    * @return string $sorting
    */
   public function getSorting() {
      return $this->sorting;
   }

   /**
    * Sets the sorting
    *
    * @param string $sorting
    * @return void
    */
   public function setSorting($sorting) {
      $this->sorting = $sorting;
   }

   /**
    * Returns the contentType
    *
    * @return string $contentType
    */
   public function getContentType() {
      return $this->contentType;
   }

   /**
    * Sets the contentType
    *
    * @param string $contentType
    * @return void
    */
   public function setContentType($contentType) {
      $this->contentType = $contentType;
   }

   /**
    * bodytext
    *
    * @var string
    */
   protected $bodytext = '';
   /**
    * Returns the bodytext
    *
    * @return string $bodytext
    */
   public function getBodytext() {
      return $this->bodytext;
   }

   /**
    * Sets the bodytext
    *
    * @param string $bodytext
    * @return void
    */
   public function setBodytext($bodytext) {
      $this->bodytext = $bodytext;
   }
}
class ContentRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
{
    public function setStoragePageId($storagePid) {
        $querySettings = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings'); 
        $querySettings->setRespectStoragePage(FALSE); 
        $querySettings->setStoragePageIds(array($storagePid)); 
        $this->setDefaultQuerySettings($querySettings);
    }
    
}

Helper for Frontend-Editing Extensions

SETUP: ExampleFiles

Helper-Extension-GIT: infochy_helper
Helper-Extension-TER: infochy_helper

Example-Extension-TER:
infochy_feeditexample
Example-Extension-GIT: infochy_feeditexample

Installation

1. Installiere infochy_helper

2. Installiere infochy_feeditexample

3. Plugin (Private Plugin – Extbase Example/ Public Plugin – Extbase Example) anlegen und Record Storage Page defenieren im Plugin

4. Installiere fe_login und FeUser im Backend anlegen

Informationen für eigene Extension

1. Mit dem ExtensionBuilder ein Frontend plugin erzeugen. Model im „aggregate root“ anlegen, damit ein Controller angelegt wird. Im Model die Propertys User(int) und Image(image*) festlegen.

2. In der eigenen Extension den BaseHelperController erben und Einstellungen ($modelObjNameCreateAction,$modelObjNameUpdateAction,$fileadminFolder,$actionNameOnAccessFailed,$imagePropertyNameInModel) definieren.

3. Model für hiddenRecords freischalten: $hiddenRecordsObjectConverter + TypeConvert anlegen + Instanzieren in ext_localconf.php

4. PropertyMapper Action festlegen: $actionGetRecord, $actionModificationRecord, $actionCreateRecord

5. Domain erweiteren (BaseHelperModel,
BaseHelperRepository)

6. TCA definieren

7. Edit und New Fluid-Action-Template bearbeiten

8. Partial Template bearbeiten

8. FormErrors.html ersetzen.

9. Aktion anlegen + ext_localconf.php + Fluid

DateTimeConverter

public function initializeCreateAction()
{
	$this->setDateTimePropertyDateTimeConverter('newModel','dateStart');
}    
public function initializeUpdateAction()
{
	$this->setDateTimePropertyDateTimeConverter('model','dateStart');
}
protected function setDateTimePropertyDateTimeConverter($modelName,$propertyName){
	$this->arguments[$modelName]
	->getPropertyMappingConfiguration()
	->forProperty($propertyName)
	->setTypeConverterOption('TYPO3\CMS\Extbase\Property\TypeConverter\DateTimeConverter', 
	\TYPO3\CMS\Extbase\Property\TypeConverter\DateTimeConverter::CONFIGURATION_DATE_FORMAT, 
	'd-m-y');		
}

Make Typo3 superfast

GIT: https://github.com/wallpageNET/superfasttypo3

Extbase ist langsam…. Typo3 ist langsam… Typo3-Performance-Tuning kostet zuviel Zeit und Geld…

Warum dann nicht die Ausgabe direkt über Marker modifizieren für dynamische Anwendungen???

Damit Typo3 ein dynamischen schnelles CMS ist und kein statisches CMS…

Vorteile

  • Weniger Energieverbrauch / Weniger Treibhauseffekt
  • Einfacher
  • Billiger
  • Schneller

index.php

if (version_compare(PHP_VERSION, '5.5.0', '<')) { die('TYPO3 CMS requires PHP 5.5 or above'); } ob_start(); // Set up the application for the Frontend call_user_func(function () { $classLoader = require rtrim(realpath(__DIR__ . '/typo3'), '\\/') . '/../vendor/autoload.php'; (new \TYPO3\CMS\Frontend\Http\Application($classLoader))->run();
});
$output = ob_get_contents();
ob_end_clean();
$output = str_replace("###superfasttypo3.hallowelt###", "<strong>Make Typo3 superfast!</strong>", $output);
echo ($output);

Jetzt nur noch einen Plugin-Loader programmieren und schon kann man eigene Plugins programmieren mit ganz einfachem PHP und man muss keine super teueren OOP-Entwickler mehr bezahlen…

index.php

if (version_compare(PHP_VERSION, '5.5.0', '<')) { die('TYPO3 CMS requires PHP 5.5 or above'); } ob_start(); // Set up the application for the Frontend call_user_func(function () { $classLoader = require rtrim(realpath(__DIR__ . '/typo3'), '\\/') . '/../vendor/autoload.php'; (new \TYPO3\CMS\Frontend\Http\Application($classLoader))->run();
});
$output = ob_get_contents();
ob_end_clean();
require_once 'superfasttypo3/api.php';
echo (superfasttypo3_api_modify_output($output));

GIT: https://github.com/wallpageNET/superfasttypo3

ConjunctionValidator

public function initializeCreateAction() {
    if ($this->arguments->hasArgument('newModel')) {
        // \TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator 
        $conjunctionValidator = $this->arguments->getArgument('newModel')->getValidator();
        foreach ($conjunctionValidator->getValidators() as $validator) {
            $conjunctionValidator->removeValidator($validator);
        }
    }
}

Fluid – Exception bei prependOptionLabel & prependOptionValue

FLUID

<f:form.select property="Option" options="{Option}" optionValueField="uid" optionLabelField="title" prependOptionValue=""  prependOptionLabel="Bitte wählen"/>

Exception:

Exception while property mapping at property path „“: PHP Catchable Fatal Error: Argument 1 passed to …

Lösung: $option = null

/**
 * Sets the option
 *
 * @param \VendorName\ExtensionName\Domain\Model\Option $option
 * @return void
 */
public function setOption(\VendorName\ExtensionName\Domain\Model\Option $option = null)
{
    $this->option = $option;
}