[Typo3-dev] Extension questions (records and php editing)

Christian Kuhn ckuhn at online.de
Mon Oct 20 16:40:30 CEST 2003


Hi Marcin!


Am Mo, den 20.10.2003 schrieb Marcin um 15:30:
> 1. I made my first extension and when I'm editing the php files I save the
> changes (the md5 of the file changes ok). And when I'm trying to make
> changes to the extension with extension kickstarter the php file I edited is
> gone and the former version is restored.
> 
The Kickstarter will allways overwrite your changes, and recreate all
extension files. Copy your files before fiddling with the kickstarter on
existing extensions and merge them afterwards again.


> 2. The extension I have writen makes record on one of my pages on the
> pagetree, and this records are accessible on this page. How can I make them
> to be accessible form other pages somewhere else in the pagetree?
> 
You have to change your SQLs then. I usually write my own sql and dont
use the typo functions for that. Dont know, if this is the optimal way,
but I do it this way, if I want to make use of records from one page on
another one:


I set a TS-option like this:
plugin.tx_myplugin_pi1.datapid = 345

In php I do this:
// if datapid is not set -> get data records with pid of current page
if ( !isset($this->conf["datapid"]) ) 
{
	$this->conf["datapid"] = $GLOBALS["TSFE"]->id;
}

//Now build the query
$query = "SELECT this,that FROM tx_myplugin_mytable " .  
	"WHERE pid=" .$datapid .
	$this->cObj->enableFields("tx_myplugin_mytable");


This works fine for me, hope it helps.


Greetings
Christian






More information about the TYPO3-dev mailing list