ext_localconf.php

 

  ## Extending TypoScript from static template uid=43 to set up userdefined tag:
t3lib_extMgm::addTypoScript($_EXTKEY,'editorcfg','tt_content.CSS_editor.ch.tx_testering_pi1 = < plugin.tx_testering_pi1.CSS_editor',43);
t3lib_extMgm::addPItoST43($_EXTKEY,'pi1/class.tx_testering_pi1.php','_pi1','list_type',1);

  ## Extending TypoScript from static template uid=43 to set up userdefined tag:
t3lib_extMgm::addTypoScript($_EXTKEY,'editorcfg','tt_content.CSS_editor.ch.tx_testering_pi2 = < plugin.tx_testering_pi2.CSS_editor',43);
t3lib_extMgm::addPItoST43($_EXTKEY,'pi2/class.tx_testering_pi2.php','_pi2','list_type',0);

 

 

class.tx_myextension_pi?.php

/**
 * Plugin 'cached' for the extension.
 */
class tx_myextension_pi1 extends tslib_pibase {
	// Same as class name
	var $prefixId      = 'tx_myextension_pi1';	
	// Path to this script relative to the extension dir.
	var $scriptRelPath = 'pi1/class.tx_myextension_pi1.php';	
	var $extKey        = 'myextension';	// The extension key.
var $pi_checkCHash = true;
/** * The main method of the PlugIn * * @param string $content: The PlugIn content * @param array $conf: The PlugIn configuration * @return The content that is displayed on the website */ function main($content,$conf) { $this->conf=$conf; $this->pi_setPiVarDefaults(); $this->pi_loadLL();
$content='...'; return $this->pi_wrapInBaseClass($content); } }
/**
 * Plugin 'uncached' for the extension.
 */
class tx_myextension_pi2 extends tslib_pibase {
	// Same as class name
	var $prefixId      = 'tx_myextension_pi2';	
	// Path to this script relative to the extension dir.
	var $scriptRelPath = 'pi2/class.tx_myextension_pi2.php';
	var $extKey        = 'myextension';	// The extension key.
/** * The main method of the PlugIn * * @param string $content: The PlugIn content * @param array $conf: The PlugIn configuration * @return The content that is displayed on the website */ function main($content,$conf) { $this->conf=$conf; $this->pi_setPiVarDefaults(); $this->pi_loadLL();
// Configuring so caching is not expected. // This value means that no cHash params are ever set. // We do this, because it's a USER_INT object! $this->pi_USER_INT_obj=1;
$content='...'; return $this->pi_wrapInBaseClass($content); } }

soll eine Extension den Cache dynamisch für eine gesamte Seite deaktivieren kann sie dies mit folgender Anweisung machen:

$GLOBALS['TSFE']->set_no_cache();

ACHTUNG!: Damit wird die gesamte Seite nicht gecacht. Wird die Extension in diesem Modus auf allen Seiten benutzt wird so das gesamte Caching deaktiviert.

 

Möchte man nur die Ausgabe des Plugins einmalig vom Caching ausnehen kann man das mit folgedem Code machen:

if ($this->cObj->getUserObjectType() == tslib_cObj::OBJECTTYPE_USER) {
	$this->cObj->convertToUserIntObject();
}

Ansonsten muss das Plugin erstmal als USER (cachable) deklariert werden.

 
Ihre aktuelle Seitenauswahl:  
>>>